I have my website in main domain, like http://www.example.com and my api in https://api.example.com and I'm trying to get data from the api with vue and axios and always I get CORS error
Access to XMLHttpRequest at 'http://www.api.example.com/api/posts' from origin 'http://www.example.com' 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
. How can I solve this?