fix: issue with resolving dev environment (#501)

* fix: issue with resolving dev environment

* fix: revert accidental commtit

* chore: version bump
This commit is contained in:
Carlos Valente
2023-08-31 22:08:18 +02:00
committed by GitHub
parent a3bbd74db7
commit 23dcca5527
6 changed files with 8 additions and 7 deletions
+2 -1
View File
@@ -12,9 +12,10 @@ export const RUNTIME = ['runtimeStore'];
const location = window.location;
const socketProtocol = location.protocol === 'https:' ? 'wss' : 'ws';
export const isProduction = import.meta.env.MODE === 'production';
const STATIC_PORT = 4001;
export const serverPort = import.meta.env.DEV ? STATIC_PORT : location.port;
export const serverPort = isProduction ? location.port : STATIC_PORT;
export const serverURL = `${location.protocol}//${location.hostname}:${serverPort}`;
export const websocketUrl = `${socketProtocol}://${location.hostname}:${serverPort}/ws`;