File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,12 @@ def __init__(self, api_key: str):
73
73
)
74
74
75
75
self .api_key = api_key
76
+ self .base_url = os .getenv ("OPENLAYER_SERVER_URL" , OPENLAYER_ENDPOINT ).rstrip (
77
+ "/"
78
+ )
79
+ if not self .base_url .endswith ("/v1" ):
80
+ self .base_url += "/v1"
81
+
76
82
self ._headers = {
77
83
"Content-Type" : "application/json" ,
78
84
"Authorization" : f"Bearer { self .api_key } " ,
@@ -143,7 +149,7 @@ def _api_request(
143
149
):
144
150
"""Make any HTTP request + error handling."""
145
151
146
- url = f"{ OPENLAYER_ENDPOINT } /{ endpoint } "
152
+ url = f"{ self . base_url } /{ endpoint } "
147
153
148
154
res = self ._http_request (
149
155
method = method ,
Original file line number Diff line number Diff line change 23
23
)
24
24
"""
25
25
26
- __version__ = "0.1.0a35 "
26
+ __version__ = "0.1.0a36 "
You can’t perform that action at this time.
0 commit comments