From ac6f635c4d724cc3e1e90bb0a300d5eb476dcc86 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 17 Jan 2020 21:04:51 +0100 Subject: api --- cli/app/settings/app_cfg.py | 6 ++++++ cli/app/utils/cortex_utils.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/app/settings/app_cfg.py b/cli/app/settings/app_cfg.py index b5c383b..16f5b25 100644 --- a/cli/app/settings/app_cfg.py +++ b/cli/app/settings/app_cfg.py @@ -46,6 +46,12 @@ os.makedirs(DIR_OUTPUTS, exist_ok=True) os.makedirs(DIR_RESULTS, exist_ok=True) os.makedirs(DIR_RENDERS, exist_ok=True) +# ----------------------------------------------------------------------------- +# Cortex +# ----------------------------------------------------------------------------- + +API_REMOTE = os.environ('API_REMOTE') || 'https://lens.neural.garden' + # ----------------------------------------------------------------------------- # Model config # ----------------------------------------------------------------------------- diff --git a/cli/app/utils/cortex_utils.py b/cli/app/utils/cortex_utils.py index ccebdc6..7974502 100644 --- a/cli/app/utils/cortex_utils.py +++ b/cli/app/utils/cortex_utils.py @@ -9,7 +9,7 @@ from app.settings import app_cfg def api_url(path): """Generate a base API path""" - return "https://mirror.neural.garden/api/{}/".format(path) + return "{}/api/{}/".format(app_cfg.API_REMOTE, path) def cortex_folder(opt_folder_id): return fetch_json(os.path.join(api_url('folder'), str(opt_folder_id) + "/")) -- cgit v1.2.3-70-g09d2