about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2022-09-08 22:40:35 +0530
committerArun Isaac2022-09-08 22:59:49 +0530
commit203d073c9c28b2aa26c78718160136dab6dd8470 (patch)
treecdaa51de5af78b4d92bead1b607832da45ab69f6
parent08a937631da94c8158068072d2ce2346c29e9cbe (diff)
downloadgenenetwork2-203d073c9c28b2aa26c78718160136dab6dd8470.tar.gz
Make GN_SERVER_URL the genenetwork3 API endpoint.
From now on, GN_SERVER_URL will be the genenetwork3 API endpoint. For
example, GN_SERVER_URL=https://gn3.genenetwork.org/api

* wqflask/wqflask/collect.py (view_collection),
wqflask/wqflask/partial_correlations_views.py (partial_correlations,
poll_partial_correlation_results),
wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js (defaultStatusCodeFunctions):
Do not append api to GN_SERVER_URL.
* etc/default_settings.py (GN_SERVER_URL): Append /api.
-rw-r--r--etc/default_settings.py2
-rw-r--r--wqflask/wqflask/collect.py2
-rw-r--r--wqflask/wqflask/partial_correlations_views.py6
-rw-r--r--wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js2
4 files changed, 6 insertions, 6 deletions
diff --git a/etc/default_settings.py b/etc/default_settings.py
index ff84f021..7ae305ed 100644
--- a/etc/default_settings.py
+++ b/etc/default_settings.py
@@ -40,7 +40,7 @@ GN_PROXY_URL="https://genenetwork.org/gn3-proxy/"
 
 SQL_URI = "mysql://gn2:mysql_password@localhost/db_webqtl_s"
 SQL_ALCHEMY_POOL_RECYCLE = 3600
-GN_SERVER_URL = "http://localhost:8880/" # REST API server
+GN_SERVER_URL = "http://localhost:8880/api" # REST API server
 GN2_BASE_URL = "http://genenetwork.org/" # to pick up REST API
 GN2_BRANCH_URL = GN2_BASE_URL
 
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py
index 87a96a26..b344bd99 100644
--- a/wqflask/wqflask/collect.py
+++ b/wqflask/wqflask/collect.py
@@ -277,7 +277,7 @@ def view_collection():
     collection_info = dict(
         trait_obs=trait_obs,
         uc=uc,
-        heatmap_data_url=f"{GN_SERVER_URL}api/heatmaps/clustered")
+        heatmap_data_url=f"{GN_SERVER_URL}/heatmaps/clustered")
 
     if "json" in params:
         return json.dumps(json_version)
diff --git a/wqflask/wqflask/partial_correlations_views.py b/wqflask/wqflask/partial_correlations_views.py
index 358a9d3b..91948722 100644
--- a/wqflask/wqflask/partial_correlations_views.py
+++ b/wqflask/wqflask/partial_correlations_views.py
@@ -287,7 +287,7 @@ def partial_correlations():
                 "with_target_db": args["with_target_db"]
             }
             return handle_response(requests.post(
-                url=f"{GN_SERVER_URL}api/correlation/partial",
+                url=f"{GN_SERVER_URL}/correlation/partial",
                 json=post_data))
 
         for error in args["errors"]:
@@ -302,7 +302,7 @@ def partial_correlations():
                 "with_target_db": args["with_target_db"]
             }
             return handle_response(requests.post(
-                url=f"{GN_SERVER_URL}api/correlation/partial",
+                url=f"{GN_SERVER_URL}/correlation/partial",
                 json=post_data))
 
         for error in args["errors"]:
@@ -347,7 +347,7 @@ def process_pcorrs_command_output(result):
 @app.route("/partial_correlations/<command_id>", methods=["GET"])
 def poll_partial_correlation_results(command_id):
     response = requests.get(
-        url=f"{GN_SERVER_URL}api/async_commands/state/{command_id}")
+        url=f"{GN_SERVER_URL}/async_commands/state/{command_id}")
 
     if response.status_code == 200:
         data = response.json()
diff --git a/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js b/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js
index b58b7c70..29c9d3c1 100644
--- a/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js
+++ b/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js
@@ -38,7 +38,7 @@ if (typeof gn_server_url === 'undefined'){
   gn_server_url = $("#search form").attr("data-gn_server_url")
 }
 
-$.ajax(gn_server_url +'api/menu/generate/json', {
+$.ajax(gn_server_url +'/menu/generate/json', {
   dataType: 'json',
   success: process_json,
   error: indicate_error,