Answer the question
In order to leave comments, you need to log in
How to solve the problem with CORS?
Hello everyone, there is a site written on the MERN stack, I posted it on the heroku service.
An error appears related to the cors policy, well, I connected the cors module, configured it
const corsOptions = {
"origin": "*",
"methods": "GET,HEAD,PUT,PATCH,POST,DELETE",
"preflightContinue": false,
"optionsSuccessStatus": 204,
"allowedHeaders": ["Content-Type"]
}
app.use(cors(corsOptions))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question