Closed tranhuy605 closed 5 years ago
@tranhuy605 Did you set all the environment variables? Can you list the routes with php artisan api:routes?
Example dingo related .env variables:
API_STANDARDS_TREE=x
API_SUBTYPE=example
API_PREFIX=api
API_DOMAIN=
API_VERSION=v1
API_NAME="example API"
API_CONDITIONAL_REQUEST=true
API_STRICT=false
API_DEFAULT_FORMAT=json
API_DEBUG=true
JWT_SECRET=
+1 Same problem here.
Laravel or Lumen? Can you post here your .env file?
Yes, I'm sorry, this is my API configuration:
API_NAME="USOE Backend" API_DEBUG=true API_DOMAIN=localhost:8002 API_VERSION=v1 API_DEFAULT_FORMAT=json API_STANDARDS_TREE=x API_SUBTYPE=example API_PREFIX=api API_CONDITIONAL_REQUEST=true API_STRICT=false
I'm running Laravel 5.6 in a Docker instance with Nginx 1.10 and PHP 7.2, on every API call I have a response "404 Not Found" with this trace:
"debug": { "line": 179, "file": "/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php", "class": "Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException", ...
Wouldn't you want your API_PREFIX to be null in this case? Otherwise it will want something like http://api.127.0.0.1:8000
I'm sorry, yes my API_PREFIX option is empty right now and I did remove the port value from the API_DOMAIN and write only "localhost".
Not matters if my project is in port 8002, in my Dingo configuration I say it's localhost and this its works.
Maybe @tranhuy605 this is you need to solve your problem.
@Piquinikis how did you manage to solve this? I've tried every possible solution found on the internet and in this git
@coilnovasince1985jenkins I solved that problem setting an empty string as API_DOMAIN
value. Right now, I have the project running in Laravel 5.8 with Dingo 2.0 and haven't any problem.
Good luck!
@gazben please help me, list for me all env required in migration from 5.8 to 6, dingo 2.4.7
When i run "php artisan serve" and then config API_DOMAIN=http://127.0.0.1:8000 but all route use dingo can't access it throw 404 error