adding some cors to allow silvrtree to get the stuff
This commit is contained in:
parent
c105c28050
commit
cb0f85e772
@ -16,6 +16,12 @@ 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");
|
||||
next();
|
||||
});
|
||||
|
||||
app.use('/gettrains', cache('60 seconds'), train.getTrainTimes);
|
||||
app.use('/getnexttraintimes', cache('60 seconds'), train.getNextTrainTimes);
|
||||
app.use('/getroute', cache('60 seconds'), train.getRoute);
|
||||
|
Loading…
Reference in New Issue
Block a user