I would like to allow access to cross origin calls which I need to be able to perform rest API calls to the server.
My connect grunt task is configured as follows:>
Nod to bpaul, who set me on the path to correct answer. The format of a response to a similar question will work here.
Replace 'next' with middlewares, and push your anonymous function into the middleware array before returning it:
middleware: function(connect, options, middlewares) {
middlewares.unshift(function(req, res, next) {
res.setHeader('Access-Control-Allow-Credentials', true);
res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
res.setHeader('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
next();
});
return middlewares;
}