2.0.0 • Published 6 years ago

routing-api v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Routing API 2.0.0

const RoutingApi = require('routing-api');

const client = new RoutingApi();

client.routing('x:2.352222 y:48.856614', 'x:-0.5791800 y:44.837789')
  .then(console.log)
  .catch(console.error);;

Installation

npm install routing-api

Requests

With endpoints

You now have the ability to make GET requests against the API via the convenience methods.

client.get(path, params);

You can use the defined client methods to call endpoints.

With client methods

client.routing('x:2.352222 y:48.856614', 'x:-0.5791800 y:44.837789');

Promises

The request will return Promise.

client.routing('x:2.352222 y:48.856614', 'x:-0.5791800 y:44.837789')
  .then(function (data) {
    console.log(data);
  })
  .catch(function (e) {
    throw e;
  });