vendredi 4 août 2017

Laravel 5.4 API not working with direct access

I have an API that uses barryvdh/laravel-cors for CORS.

If I do php artisan serve, and access my api via localhost:8000/api/something then it works.

However if I try to access localhost/project/public/api/something, then I get an error saying

Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://ift.tt/2v4IK3n' is therefore not allowed access.

Any ideas what's causing this issue?

Further Information: I need to access the API via the public/ directory because I'm configuring a virtual Host to have the API (and UI) work via SSL (self-signed certificates)



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2u93cgR
via IFTTT

Aucun commentaire:

Enregistrer un commentaire