aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2022-05-03 20:47:05 -0500
committerJP Dillingham <jpdillingham@gmail.com>2022-05-03 20:47:05 -0500
commit536b9c3192929cced4a8925d9dbc8bec85736524 (patch)
tree20c5f4eafc90eee5285748ac0acc8aa1009df174 /src
parent56d9a2a52a0efd67f9bf6a6e24c1644a0e9fb6c6 (diff)
downloadslskd-536b9c3192929cced4a8925d9dbc8bec85736524.tar.gz
retrieve urlBase from window variables
Diffstat (limited to 'src')
-rw-r--r--src/web/src/config.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/web/src/config.js b/src/web/src/config.js
index ea71e9dd..8acec820 100644
--- a/src/web/src/config.js
+++ b/src/web/src/config.js
@@ -1,5 +1,7 @@
-const rootUrl = process.env.NODE_ENV === 'production' ? '' : 'http://localhost:5000/';
-const baseUrl = `${rootUrl}api/v0`;
+const 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';
const tokenPassthroughValue = 'n/a';
const activeChatKey = 'slskd-active-chat';
@@ -7,8 +9,10 @@ const activeRoomKey = 'slskd-active-room';
const activeUserInfoKey = 'slskd-active-user';
export {
+ urlBase,
rootUrl,
- baseUrl,
+ apiBaseUrl,
+ hubBaseUrl,
tokenKey,
tokenPassthroughValue,
activeChatKey,