I tried to ‘get’ with js and got this error:
Access to fetch at 'http://localhost/ca/api/content/items/news' from origin 'http://localhost:3000' 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. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
my request looks like this
return await fetch(`${BASE_URL}/${endpoint}`, {
headers: {
"api-key": API_KEY,
},
method: 'GET',
})
But when i`m trying to get with postman everything works fine.