From 536b9c3192929cced4a8925d9dbc8bec85736524 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 3 May 2022 20:47:05 -0500 Subject: retrieve urlBase from window variables --- src/web/src/config.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') 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, -- cgit v1.2.3