-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Api group 404 not found #1768
Comments
same problem, api group return 404 after migration from laravel 5.8 to 6, dingo api 2.4.7 from 2.3.0 |
Hey, can you please post your http Kernel.php file? |
In my case solve by domain in .env |
@fredroo Do you mean API_DOMAIN, right? @specialtactics This problem cause sometimes. I really want to know for where to debug or checking first. In my case when I using same configuration, but different environment, domain etc. Domain is the one factor to made route always return 404, right? Is it possible to share dingo API logic for routing? |
@ALTELMA yes |
Thanks for your suggestion @fredroo. My case depends on the configuration of the server, but it can end the problem as you mentioned. Normally I using Nginx for proxy and API_DOMAIN related to the internal proxy_pass such as order-service, payment-service. When I try to change to use Ingress Nginx Controller API_DOMAIN should replace by a real domain. Hopefully, this helps someone fix your problem. |
Thanks @fredroo indeed it was the issue |
Hey @ALTELMA
Yes, this logic is in the code which is shared via this repository 😛 |
@specialtactics , I am also facing the same issue. I am getting 404 error for my API routes. Other routes are working fine. "php artisan api:routes" command would list all API routes, but those returning 404. Any suggestion would be appreciated. I am using below configuration values in my .env file API_PREFIX= My kernal.php file is below, protected $middleware = [ protected $middlewareGroups = [
protected $routeMiddleware = [ |
@RajuPuthen plz post your HTTP kernel file and env file and what is the URL you are using to access them. |
1223/5000
Actual behavior
api.php
$api = app('Dingo\Api\Routing\Router');
$api->group(["version"=>"v1","namespace"=>"\App\Http\Controllers\Admin","prefix"=>"admin"], function ($api) {
$api->get("login","LoginController@login")->name("admin.login");
});
404 not found
sail@caca0a954c1f:/var/www/html$ php artisan api:routes
+------+----------+-------------+-------------+--------------------------------------------------+-----------+------------+----------+------------+
| Host | Method | URI | Name | Action | Protected | Version(s) | Scope(s) | Rate Limit |
+------+----------+-------------+-------------+--------------------------------------------------+-----------+------------+----------+------------+
| | GET|HEAD | admin/login | admin.login | App\Http\Controllers\Admin\LoginController@login | No | v1 | | |
+------+----------+-------------+-------------+--------------------------------------------------+-----------+------------+----------+------------+
The text was updated successfully, but these errors were encountered: