has been blocked by cors policy in express react

 Using npm:

To allow cross-origin requests install ‘cors’:

npm i cors

Add this in the server-side:

let cors = require("cors");
app.use(cors());

Leave a Comment

Your email address will not be published. Required fields are marked *