aboutsummaryrefslogtreecommitdiffstats
path: root/src/web
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2022-05-03 21:21:31 -0500
committerJP Dillingham <jpdillingham@gmail.com>2022-05-03 21:21:31 -0500
commitab66d41d8676ceda951f0bb1b7d940c09f2f1c2d (patch)
tree7c7ba7b870cde76434a51123a89b2a657fc22e37 /src/web
parentdd76dd55f13aaab06249b64fe897287356bdeb02 (diff)
downloadslskd-ab66d41d8676ceda951f0bb1b7d940c09f2f1c2d.tar.gz
add urlBase script to index
Diffstat (limited to 'src/web')
-rw-r--r--src/web/public/index.html1
-rw-r--r--src/web/src/config.js4
2 files changed, 3 insertions, 2 deletions
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 @@
<div id="root"></div>
</body>
</html>
+<script>window.urlBase="/"</script> \ 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';