Added route details

This commit is contained in:
martind2000 2016-01-15 11:02:41 +00:00
parent 80aefd0a6f
commit 241e5c3518
2 changed files with 19 additions and 0 deletions

View File

@ -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');
}
}
};

View File

@ -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);