Added support for http request methods.
This commit is contained in:
parent
08e125f0b2
commit
da004dc578
@ -37,6 +37,13 @@ module.exports = function(app, historicSync, peerSync) {
|
|||||||
app.use(express.methodOverride());
|
app.use(express.methodOverride());
|
||||||
app.use(express.compress());
|
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) {
|
if (config.publicPath) {
|
||||||
var staticPath = path.normalize(config.rootPath + '/../' + config.publicPath);
|
var staticPath = path.normalize(config.rootPath + '/../' + config.publicPath);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user