diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/public/index.html | 1 | ||||
| -rw-r--r-- | src/web/src/config.js | 4 |
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'; |
