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

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

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