loading
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const request = require('request');

var req = {
  url: 'https://api.digitransit.fi/routing/v1/routers/hsl/index/graphql',
  method: 'POST',
  headers: { "Content-Type": "application/json" },
  body: { "query": `{
    stop(id: \"HSL:1040129\") {
      name
      lat
      lon
      wheelchairBoarding
    }
  }` },
  json: true
};

request(req, function (error, response, body) {
  if (!error && response.statusCode == 200) {
    console.log(JSON.stringify(body, null, 4)); 
  }
});
node v10.16.0