You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can either require the whole client enabling you to use every GraphHopper API, but you can also only require the pieces you need.
require('graphhopper-js-api-client');window.onload=function(){letdefaultKey="[Sign-up for free and get your own key: https://www.graphhopper.com/products/]";letghRouting=newGraphHopper.Routing({key: defaultKey},{profile:"car",elevation: false});ghRouting.doRequest({points:[[8.534317,47.400905],[8.538265,47.394108]]}).then(json=>{// Add your own result handling hereconsole.log(json);}).catch(err=>{console.error(err.message);});};
Running Tests
In order to run the tests, you have to register for a key on GraphHopper.
Either set your key as environment variable using export GHKEY=YOUR_KEY or set your key in spec/helpers/config.js.
You can run all tests via npm test.
If you only want to run a single spec file, you can use the --spec option, e.g., npm test --spec spec/GraphHopperRoutingSpec.js.
Integrate the APIs in your application
You can either use our bundled version, including all APIs or you can use only the
pieces you need.