Add response codes of trip and routability queries
This commit is contained in:
parent
e2b7e8a4da
commit
a44b63fbb9
@ -126,6 +126,7 @@ module.exports = function () {
|
|||||||
|
|
||||||
r.query = this.query;
|
r.query = this.query;
|
||||||
r.json = JSON.parse(body);
|
r.json = JSON.parse(body);
|
||||||
|
r.code = r.json.code;
|
||||||
r.status = res.statusCode === 200 ? 'x' : null;
|
r.status = res.statusCode === 200 ? 'x' : null;
|
||||||
if (r.status) {
|
if (r.status) {
|
||||||
r.route = this.wayList(r.json.routes[0]);
|
r.route = this.wayList(r.json.routes[0]);
|
||||||
|
@ -29,8 +29,10 @@ module.exports = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var json;
|
var json;
|
||||||
|
got.code = 'unknown';
|
||||||
if (res.body.length) {
|
if (res.body.length) {
|
||||||
json = JSON.parse(res.body);
|
json = JSON.parse(res.body);
|
||||||
|
got.code = json.code;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headers.has('status')) {
|
if (headers.has('status')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user