From ab66d41d8676ceda951f0bb1b7d940c09f2f1c2d Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 3 May 2022 21:21:31 -0500 Subject: add urlBase script to index --- src/web/public/index.html | 1 + src/web/src/config.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/web') diff --git a/src/web/public/index.html b/src/web/public/index.html index e452c8c8..fa11b640 100644 --- a/src/web/public/index.html +++ b/src/web/public/index.html @@ -10,3 +10,4 @@
+ \ No newline at end of file diff --git a/src/web/src/config.js b/src/web/src/config.js index 8acec820..6f899564 100644 --- a/src/web/src/config.js +++ b/src/web/src/config.js @@ -1,5 +1,5 @@ -const urlBase = window.urlBase || ''; -const rootUrl = process.env.NODE_ENV === 'production' ? urlBase : `http://localhost:5000${urlBase}`; +const urlBase = (window.urlBase === '/' ? '' : window.urlBase) || ''; +const rootUrl = process.env.NODE_ENV === 'production' ? urlBase : `http://localhost:5000/${urlBase}`; const apiBaseUrl = `${rootUrl}/api/v0`; const hubBaseUrl = `${rootUrl}/hub`; const tokenKey = 'slskd-token'; -- cgit v1.2.3