Added support for http request methods.

This commit is contained in:
Gustavo Cortez 2014-04-15 16:45:26 -03:00
parent 08e125f0b2
commit da004dc578
1 changed files with 7 additions and 0 deletions

View File

@ -37,6 +37,13 @@ module.exports = function(app, historicSync, peerSync) {
app.use(express.methodOverride());
app.use(express.compress());
app.use(function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
next();
});
if (config.publicPath) {
var staticPath = path.normalize(config.rootPath + '/../' + config.publicPath);