Answers for "express use cors problem with post"

-1

express cors error

// CORS (Cross-Origin Resource Sharing) headers to support Cross-site HTTP requests

app.all('*', function(req, res, next) {
       res.header("Access-Control-Allow-Origin", "*");
       res.header("Access-Control-Allow-Headers", "X-Requested-With");
       res.header('Access-Control-Allow-Headers', 'Content-Type');
       next();
});
Posted by: Guest on July-09-2021
0

cors error in node js express

var cors = require('cors')

var app = express()
app.use(cors())
Posted by: Guest on September-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language