From ec2f6cc3587471bd11284db8e58f66164b3152ee Mon Sep 17 00:00:00 2001 From: "C. Fuhrman" Date: Sat, 11 Jan 2025 11:27:36 -0500 Subject: [PATCH 1/3] =?UTF-8?q?Renommer=20.env=20=C3=A0=20.env.development?= =?UTF-8?q?=20Vite=20est=20cens=C3=A9=20ignorer=20=C3=A7a=20en=20productio?= =?UTF-8?q?n=20(docker)=20tandis=20que=20.env=20serait=20toujours=20charg?= =?UTF-8?q?=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/{.env => .env.development} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename client/{.env => .env.development} (100%) diff --git a/client/.env b/client/.env.development similarity index 100% rename from client/.env rename to client/.env.development From 7c5c6739fa51990df8f964b5692736f0dd8adc42 Mon Sep 17 00:00:00 2001 From: "C. Fuhrman" Date: Sat, 11 Jan 2025 11:28:51 -0500 Subject: [PATCH 2/3] =?UTF-8?q?D=C3=A9finir=20les=20variables=20VITE=5F*?= =?UTF-8?q?=20(vide)=20Vite=20est=20cens=C3=A9=20ne=20pas=20les=20changer?= =?UTF-8?q?=20par=20un=20.env.*=20(selon=20copilot)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 97c112f..184857f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,12 +3,13 @@ services: frontend: image: fuhrmanator/evaluetonsavoir-frontend:latest container_name: frontend + environment: + # Define empty VITE_BACKEND_URL because it's production + - VITE_BACKEND_URL= + # Define empty VITE_BACKEND_SOCKET_URL so it will default to window.location.host + - VITE_BACKEND_SOCKET_URL= ports: - "5173:5173" - environment: - VITE_BACKEND_URL: "http://localhost:4400" - # don't define VITE_BACKEND_SOCKET_URL so it will default to window.location.host - # VITE_BACKEND_SOCKET_URL: "" restart: always backend: From afef820765746ec084aacc65c7f076572b6356f0 Mon Sep 17 00:00:00 2001 From: "C. Fuhrman" Date: Sat, 11 Jan 2025 11:30:01 -0500 Subject: [PATCH 3/3] =?UTF-8?q?isDev=20n'=C3=A9tait=20pas=20pass=C3=A9=20e?= =?UTF-8?q?n=20param=C3=A8tre=20(undefined)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/app.js b/server/app.js index 4616014..570ee8b 100644 --- a/server/app.js +++ b/server/app.js @@ -52,6 +52,7 @@ const cors = require("cors"); const bodyParser = require('body-parser'); const configureServer = (httpServer, isDev) => { + console.log(`Configuring server with isDev: ${isDev}`); return new Server(httpServer, { path: "/socket.io", cors: { @@ -68,7 +69,7 @@ const server = http.createServer(app); console.log(`Environnement: ${process.env.NODE_ENV} (${isDev ? 'dev' : 'prod'})`); -const io = configureServer(server); +const io = configureServer(server, isDev); console.log(`Server configured with cors.origin: ${io.opts.cors.origin} and secure: ${io.opts.secure}`); setupWebsocket(io);