diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2022-05-03 21:21:31 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2022-05-03 21:21:31 -0500 |
| commit | ab66d41d8676ceda951f0bb1b7d940c09f2f1c2d (patch) | |
| tree | 7c7ba7b870cde76434a51123a89b2a657fc22e37 /src | |
| parent | dd76dd55f13aaab06249b64fe897287356bdeb02 (diff) | |
| download | slskd-ab66d41d8676ceda951f0bb1b7d940c09f2f1c2d.tar.gz | |
add urlBase script to index
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'; |
