adding some cors to allow silvrtree to get the stuff

This commit is contained in:
Martin Donnelly 2018-01-14 18:48:36 +00:00
parent cb0f85e772
commit 5e4d3dd22b

View File

@ -17,8 +17,10 @@ const cache = apicache.middleware;
app.use(express.static(path.join(__dirname, sitePath)));
app.all('/*', function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Credentials', 'true');
res.setHeader('Access-Control-Allow-Methods', 'GET,HEAD,OPTIONS,POST,PUT');
res.setHeader('Access-Control-Allow-Headers', 'Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers');
next();
});