diff --git a/front/src/Enum/EnvironmentVariable.ts b/front/src/Enum/EnvironmentVariable.ts index c1f9efe4..6d84df3c 100644 --- a/front/src/Enum/EnvironmentVariable.ts +++ b/front/src/Enum/EnvironmentVariable.ts @@ -1,5 +1,5 @@ const DEBUG_MODE: boolean = process.env.DEBUG_MODE == "true"; -const API_URL = window.location.protocol + '//' + process.env.API_URL || "http://api.workadventure.localhost"; +const API_URL = (window !== undefined ? window.location.protocol : 'http://') + '//' + (process.env.API_URL || "http://api.workadventure.localhost"); const RESOLUTION = 3; const ZOOM_LEVEL = 1/*3/4*/; const POSITION_DELAY = 200; // Wait 200ms between sending position events