I am on a nextJS project with a backend with Strapi: I want to set CORS in Strapi here is what I’ve done on the middleware.js file :
` {
name: 'strapi::cors',
config: {
headers: ['Content-Type', 'Authorization', 'Origin', 'Accept'],
origin: [
'http://localhost:3000',
'http://localhost:1337',
process.env.SITE_URL,
process.env.SITE_URL_INT,
process.env.STRAPI_DOMAIN
],
methods: ['GET', 'POST', 'PUT', 'DELETE'],
keepHeaderOnError: true,
}
}`
I am still in local but when I am on the port 3001 (to check if my cors policy is working) i don’t have any error CORS error and request are fine (it shouldn’t be the case cause thats not in the origin). Someone can help me please Thanks