This code is in app.js of Node.js project.
app.js
const cors = require("cors"); var corsOptions = {}; app.use(cors(corsOptions));