Answers for "xmlhttprequest has been blocked by cors policy no 'access-control-allow-origin' node with express"

0

Access to XMLHttpRequest has been blocked by CORS policy node js

/*
npm i cors
or
 yarn add cors
then in your node app
*/
const cors = require('cors');
const corsOptions ={
    origin:'http://localhost:3000', 
    credentials:true,            //access-control-allow-credentials:true
    optionSuccessStatus:200
}
app.use(cors(corsOptions));
Posted by: Guest on March-19-2021
-1

express cors policy no 'access-control-allow-origin'

$ npm install cors
Posted by: Guest on March-22-2021

Code answers related to "xmlhttprequest has been blocked by cors policy no 'access-control-allow-origin' node with express"

Code answers related to "Javascript"

Browse Popular Code Answers by Language