mirror of
https://gitlab.silvrtree.co.uk/martind2000/old-silvrgit.git
synced 2025-03-11 07:19:59 +00:00
Added route details
This commit is contained in:
parent
80aefd0a6f
commit
241e5c3518
18
lib/train.js
18
lib/train.js
@ -132,6 +132,24 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
|
||||
}, getRoute: function(req, res) {
|
||||
console.log(req);
|
||||
console.log('---------');
|
||||
console.log(req.query);
|
||||
var routeID, data={};
|
||||
if (req.query.hasOwnProperty('route')) {
|
||||
|
||||
routeID = req.query.route;
|
||||
Query(function (a, b) {
|
||||
|
||||
if (a !== null && a.message === null) {
|
||||
data = a;
|
||||
}
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.end(JSON.stringify(data));
|
||||
}, res, 'huxley.apphb.com', '/service/' + routeID + '?accessToken=215b99fe-b237-4a01-aadc-cf315d6756d8');
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -36,6 +36,7 @@ app.configure(function () {
|
||||
app.use('/glqdbe', train.glq_dbe);
|
||||
app.use('/gettrains', train.getTrainTimes);
|
||||
app.use('/getnexttraintimes', train.getNextTrainTimes);
|
||||
app.use('/getroute', train.getRoute);
|
||||
|
||||
app.use('/generate', password.generate);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user