1/*
2npm i cors
3or
4 yarn add cors
5then in your node app
6*/
7const cors = require('cors');
8const corsOptions ={
9 origin:'http://localhost:3000',
10 credentials:true, //access-control-allow-credentials:true
11 optionSuccessStatus:200
12}
13app.use(cors(corsOptions));