adding some cors to allow silvrtree to get the stuff

This commit is contained in:
Martin Donnelly 2018-01-14 18:57:22 +00:00
parent d79b566be1
commit 8b21f42a25

View File

@ -20,10 +20,10 @@ app.use(express.static(path.join(__dirname, sitePath)));
app.options('*', cors()); // include before other routes app.options('*', cors()); // include before other routes
app.use('/gettrains', cache('60 seconds'), train.getTrainTimes); app.use('/gettrains', cors(), cache('60 seconds'), train.getTrainTimes);
app.use('/getnexttraintimes', cors(), cache('60 seconds'), train.getNextTrainTimes); app.use('/getnexttraintimes', cors(), cache('60 seconds'), train.getNextTrainTimes);
app.use('/getroute', cache('60 seconds'), train.getRoute); app.use('/getroute', cors(), cache('60 seconds'), train.getRoute);
app.use('/getnews', cache('30 minutes'), train.getNews); app.use('/getnews', cors(), cache('30 minutes'), train.getNews);
app.listen(port, (err) => { app.listen(port, (err) => {
if (err) if (err)