GIScience / openrouteservice-js

:pushpin: The JavaScript API to consume openrouteservice(s) painlessly!
https://openrouteservice.org
Apache License 2.0
191 stars 35 forks source link

Allow to use self-hosted ORS #67

Closed gabsoftware closed 1 year ago

gabsoftware commented 1 year ago

Maybe I'm missing something, but I think this API can't be used with self-hosted instances of OpenRouteService. Would it be possible to add support for this?

TheGreatRefrigerator commented 1 year ago

This is probably just not documented. You should be able to pass a host argument, when initializing the client e.g.:

import Openrouteservice from 'openrouteservice-js'
let orsDirections = new Openrouteservice.Directions({ api_key: "XYZ", host: "localhost:8082/ors"});
// ...

I'm not 100% sure it works, but will try it out and get back to you

TheGreatRefrigerator commented 1 year ago

This was documented in d2752b55007400baa2a030ca9dd7feb422d93d6a