Merge pull request #44 from cmgustavo/feature/support-http-request

Added support for http request.
This commit is contained in:
Matias Alejo Garcia 2014-04-15 16:48:09 -03:00
commit 44ac7e6b10
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);