diff --git a/src/routes/multiplayer/Lobby/lobby.tsx b/src/routes/multiplayer/Lobby/lobby.tsx index 12917686c693f3c4e9f53b6b0480162cafcd60c1..e3c375295a8bc24185cfe6ca959135cd3cbe6c1a 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);