Access to XMLHttpRequest at from origin ' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the re code example
Example: Access to XMLHttpRequest has been blocked by CORS policy
/*
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));