mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-26 17:39:58 +00:00
fix: resolve to static port in dev mode
This commit is contained in:
@@ -15,14 +15,9 @@ export const RUNTIME = ['runtimeStore'];
|
|||||||
// external stuff
|
// external stuff
|
||||||
export const githubURL = 'https://api.github.com/repos/cpvalente/ontime/releases/latest';
|
export const githubURL = 'https://api.github.com/repos/cpvalente/ontime/releases/latest';
|
||||||
|
|
||||||
/**
|
export const serverPort = import.meta.env.DEV ? STATIC_PORT : window.location.port;
|
||||||
* @description finds server path given the current location, it
|
export const serverURL = import.meta.env.DEV ? `http://localhost:${serverPort}` : window.location.origin;
|
||||||
* @return {*}
|
export const websocketUrl = `ws://${window.location.hostname}:${serverPort}/ws`;
|
||||||
*/
|
|
||||||
export const calculateServer = () => (import.meta.env.DEV ? `http://localhost:${window.location.port}` : window.location.origin);
|
|
||||||
|
|
||||||
export const serverURL = calculateServer();
|
|
||||||
export const websocketUrl = `ws://${window.location.hostname}:${window.location.port}/ws`;
|
|
||||||
|
|
||||||
export const eventURL = `${serverURL}/eventdata`;
|
export const eventURL = `${serverURL}/eventdata`;
|
||||||
export const rundownURL = `${serverURL}/events`;
|
export const rundownURL = `${serverURL}/events`;
|
||||||
|
|||||||
Reference in New Issue
Block a user