Quantcast
Channel: VueJs cross origin issue - Stack Overflow
Viewing all articles
Browse latest Browse all 2

VueJs cross origin issue

0
0

I have a project with VueJs and an API provider written in PHP. Both has been installed on my localhost and I have defined a virtual host for my php project called "https://mydomain.loc".

The VueJs project can be reached at http://localhost:8080. When I want to send a post request to the api provider, I get an error as follow:

Access to XMLHttpRequest at 'http://socialbookmark.loc/api/profile'
from origin 'http://localhost:8080' has been blocked by CORS policy:
Response to preflight request doesn't pass access control check: No
'Access-Control-Allow-Origin' header is present on the requested
resource.

My web server is also Nginx.

How can I resolve this issue?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images