🦋 Adds location for socket connection

This commit is contained in:
Rune Harlyk
2024-02-04 22:13:33 +01:00
parent e1f8856b1d
commit 1536964165
2 changed files with 11 additions and 6 deletions
+6 -1
View File
@@ -1,3 +1,8 @@
const location = import.meta.env.DEV ? "leika.local" : window.location.host
const forWeb = import.meta.env.MODE === "WEB"
const mock = import.meta.env.MODE === "MOCK"
const location = mock ? `${window.location.hostname}:2096` : "leika.local"
export const socketLocation = forWeb ? `wss://${window.location.hostname}:2096` : `ws://${location}`
export default location;