diff --git a/api.py b/api.py index 0b27dc5..a955b62 100644 --- a/api.py +++ b/api.py @@ -3,8 +3,11 @@ from urllib.parse import urlencode from functools import wraps import api -# This will be overwritten by config +# This must be set to be able to use it on remote hosts BASE_URL = "http://localhost:8080/api" +def set_endpoint(base_url:str): + global BASE_URL + BASE_URL = base_url # Exceptions: class APIError(Exception): pass diff --git a/main.py b/main.py index 1f0fb28..d654fb9 100755 --- a/main.py +++ b/main.py @@ -18,7 +18,7 @@ def main(config): start_kwargs = {"standalone":config.standalone} # start the webserver: - api.BASE_URL = config.api_base + api.set_endpoint(config.api_base) start( gui.MyApp, title = "Gregorz",