From fd460676f3d6c2becda6eeae3026bf1cb21b4e9e Mon Sep 17 00:00:00 2001
From: GOEPP THOMAS <thomas@saturne-digital.fr>
Date: Thu, 16 Jan 2025 22:11:33 +0100
Subject: [PATCH] feat: url in .env

---
 src/routes/multiplayer/Lobby/lobby.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/routes/multiplayer/Lobby/lobby.tsx b/src/routes/multiplayer/Lobby/lobby.tsx
index 1291768..e3c3752 100644
--- a/src/routes/multiplayer/Lobby/lobby.tsx
+++ b/src/routes/multiplayer/Lobby/lobby.tsx
@@ -26,6 +26,7 @@ export function Lobby() {
 
     let goodId = id;
     console.log("isHost :", isHost);
+    const url = import.meta.env.VITE_API_URL;
 
     const initSSE = async () => {
         console.log("Init SSE for quiz ID:", id);
@@ -40,11 +41,11 @@ export function Lobby() {
             setRoomIdCreated(response);
         }
         console.log("User try to joined party with ID:", goodId);
-        console.log(`https://klebert-host.com:33037/party/join/${goodId}`)
+        console.log(`${url}/party/join/${goodId}`)
         interface EventData extends Event {
             data: string; // EventSource envoie toujours les données en tant que string
         }
-        const es = new EventSource(`https://klebert-host.com:33037/party/join/${goodId}`,{
+        const es = new EventSource(`${url}/party/join/${goodId}`,{
             withCredentials:true,
         });
         setEventSource(es);
-- 
GitLab