1.

What is the use of CORS in Node JS?

Answer»

CORS is a Node.js package USED for PROVIDING a Connect/Express middleware.

Example

app.use(function(REQ, RES, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  next();
});



Discussion

No Comment Found