I am having issue with CORS. I’ve tried everything as config but still getting CORS error.
I am running my app on windows VM .
Access to fetch at ‘http://172.28.20.201:4000/api/products/sliderhome’ from origin ‘http://172.28.20.201:3000’ has been blocked by CORS policy: The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard ‘*’ when the request’s credentials mode is ‘include’.`
NODEJS code:
app.use(cors())
Tried also this CORS config:
app.use(cors({
origin: '*',
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
allowedHeaders: ['Origin', 'X-Requested-With', 'Content-Type', 'Accept', 'Authorization'],
credentials: true
}));
Did you also faced this issue ?
I tried many configs to resolve cors issue
Parra is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.