gpt4 book ai didi

php - 找不到 Laravel API 路由

转载 作者:行者123 更新时间:2023-12-04 11:00:55 25 4
gpt4 key购买 nike

我正在尝试测试 API 路由,但我总是收到 404 Not Found .

我正在使用这个命令:

curl http://localhost:8000/api/veip

这是我的 routes/api.php
<?php

use Illuminate\Http\Request;

Route::get('/veip', function () {
return 'Hello World';
});

这是我的 php artisan route:list输出:
+--------+----------+----------+------+---------+------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------+----------+------+---------+------------+
| | GET|HEAD | / | | Closure | web |
| | GET|HEAD | api/veip | | Closure | api |
+--------+----------+----------+------+---------+------------+

所以路线确实存在

我不知道这里发生了什么......

最佳答案

试试 php artisan route:clear 可能对你有用

关于php - 找不到 Laravel API 路由,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51428542/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com