Skip to content

Commit

Permalink
refactor: examples to use most recent client
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakob Stolze committed Mar 19, 2024
1 parent 10cc5cb commit a49120a
Show file tree
Hide file tree
Showing 9 changed files with 3,354 additions and 44,489 deletions.
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@ These examples show common usages of this library.
import openrouteservice as ors
from pprint import pprint

# Configure API key authorization:
configuration = ors.Configuration()
configuration.api_key['Authorization'] = "YOUR_API_KEY"

# create an instance of the API class
directionsApi = ors.DirectionsServiceApi(ors.ApiClient(configuration))
directionsApi = ors.DirectionsServiceApi(
ors.apiClient(apiKey="YOUR_API_KEY") # set your api key here
)

# create request body
body = ors.DirectionsService(
Expand All @@ -85,11 +83,10 @@ except ors.rest.ApiException as e:
import openrouteservice as ors
from pprint import pprint

# Configure host
configuration = ors.Configuration()
configuration.host = "http://localhost:8080/ors"
isochronesApi = ors.IsochronesServiceApi(
ors.apiClient(host="http://localhost:8080/ors") # set host to your local instance
)

isochronesApi = ors.IsochronesServiceApi(ors.ApiClient(configuration))
body = ors.IsochronesProfileBody(
locations=[[8.681495,49.41461],[8.686507,49.41943]],
range=[300]
Expand Down
Loading

0 comments on commit a49120a

Please sign in to comment.