From 0a62f2a0f3dbb9a041435457e3234e4900fed1ca Mon Sep 17 00:00:00 2001 From: pedrocx486 Date: Fri, 31 Jan 2025 01:32:26 -0300 Subject: [PATCH] Fox bug related to boolean parsing in the client .env --- client/.env | 6 +++--- client/src/composables/useGetServer.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/.env b/client/.env index 2b0966a..ab9612c 100644 --- a/client/.env +++ b/client/.env @@ -1,4 +1,4 @@ -# If the client is being served by the server itself, set to TRUE. -# If you're running locally in dev mode, set to FALSE and update the SERVER variable to point to the server URL. -VITE_STATIC='true' +# If the client is being served by the server itself, set to 1 (ONE). +# If you're running locally in dev mode, set to 0 (ZERO) and update the SERVER variable to point to the server URL. +VITE_STATIC='1' VITE_SERVER='http://localhost:3000' diff --git a/client/src/composables/useGetServer.ts b/client/src/composables/useGetServer.ts index 3612535..af822e1 100644 --- a/client/src/composables/useGetServer.ts +++ b/client/src/composables/useGetServer.ts @@ -1,5 +1,5 @@ export const useGetServer = (): string => { - if (Boolean(import.meta.env.VITE_STATIC)) { + if (Number(import.meta.env.VITE_STATIC)) { return window.location.origin; } else { return import.meta.env.VITE_SERVER;