Request header field access-control-allow-origin is not allowed by Access-Control-Allow-Headers in preflight response
'Access-Control-Allow-Origin': '*'
const cors = require('cors');
const app = express();
app.use(cors());
const app = express();
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET, HEAD, OPTIONS, POST, PUT');
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, Authorization');
next();
});