0π
This is a server-side issue. You need to enable CORS in your apache config, by either:
- Setting
Header set Access-Control-Allow-Origin "*"
β meaning that all origins are allowed to make requests to this server - Setting
Header set Access-Control-Allow-Origin "http://localhost:3000"
This tells the server to accept requests from this origin(s), to further explain.
- [Vuejs]-Auth0 access token to API works in postman but not when calling from Vue
- [Vuejs]-Vuex | Map state β Scoping issue in beforeMount() on page refresh
0π
Change your header set statement to:
Header always set Access-Control-Allow-Origin β*β
Otherwise Apache will prepend origin in request to the header, which causes the issue.
- [Vuejs]-How to avoid 404 error for a computed property which relies on a variable obtained from API call?
- [Vuejs]-How can I add vue in mvc html tag?
Source:stackexchange.com