host detection fixed in prod mode

This commit is contained in:
Daniel Shleifman
2021-06-03 20:08:07 +03:00
parent aec2ecbb20
commit 7b2e1443f5
2 changed files with 4 additions and 4 deletions

View File

@@ -1,4 +1,6 @@
let torrserverHost = process.env.REACT_APP_SERVER_HOST || ''
const { protocol, hostname, port } = window.location
let torrserverHost = process.env.REACT_APP_SERVER_HOST || `${protocol}//${hostname}${port ? `:${port}` : ''}`
export const torrentsHost = () => `${torrserverHost}/torrents`
export const viewedHost = () => `${torrserverHost}/viewed`