adkt
2/5/2018 - 9:44 PM

CORS

CORS headers for a node.js server

// allow cors access from any external domain
app.all('/', function(req, res, next) 
{
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "X-Requested-With");
    next();
});