From 5930745919ac32338b415f1aa0e0cebfb5027727 Mon Sep 17 00:00:00 2001 From: Tariq Soliman Date: Tue, 24 Sep 2024 13:47:13 -0700 Subject: [PATCH] Fix ROOT_PATH in configure-beta --- API/Backend/Config/setup.js | 1 + configure/src/core/calls.js | 2 +- configure/src/core/constants.js | 7 +++---- configure/src/core/routes/routes.js | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/API/Backend/Config/setup.js b/API/Backend/Config/setup.js index b16dfdd3..2b691f4d 100644 --- a/API/Backend/Config/setup.js +++ b/API/Backend/Config/setup.js @@ -32,6 +32,7 @@ let setup = { }); } ); + console.log(s); s.app.get( s.ROOT_PATH + "/configure-beta", s.ensureGroup(s.permissions.users), diff --git a/configure/src/core/calls.js b/configure/src/core/calls.js index f4dc2585..02d77853 100644 --- a/configure/src/core/calls.js +++ b/configure/src/core/calls.js @@ -1,7 +1,7 @@ const domain = window.mmgisglobal.NODE_ENV === "development" ? "http://localhost:8888/" - : window.location.origin + "/"; + : window.location.origin + (window.mmgisglobal.ROOT_PATH || "") + "/"; const c = { missionPath: "Missions/", diff --git a/configure/src/core/constants.js b/configure/src/core/constants.js index 310df1f9..eabf9cc4 100644 --- a/configure/src/core/constants.js +++ b/configure/src/core/constants.js @@ -1,7 +1,6 @@ -export const publicUrl = `${(window.mmgisglobal.ROOT_PATH || "").replace( - /^\/|\/$/g, - "" -)}/configure-beta`; +export const publicUrl = `${window.location.pathname + .replace(`configure-beta`, "") + .replace(/^\//g, "")}configure-beta`; export const endpoints = {}; diff --git a/configure/src/core/routes/routes.js b/configure/src/core/routes/routes.js index 1c2b8722..9092579d 100644 --- a/configure/src/core/routes/routes.js +++ b/configure/src/core/routes/routes.js @@ -15,7 +15,6 @@ export const Routings = () => {