mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Merge branch 'main' of https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir
Some checks are pending
CI/CD Pipeline for Backend / build_and_push_backend (push) Waiting to run
CI/CD Pipeline for Nginx Router / build_and_push_nginx (push) Waiting to run
CI/CD Pipeline for Frontend / build_and_push_frontend (push) Waiting to run
Tests / tests (client) (push) Waiting to run
Tests / tests (server) (push) Waiting to run
Some checks are pending
CI/CD Pipeline for Backend / build_and_push_backend (push) Waiting to run
CI/CD Pipeline for Nginx Router / build_and_push_nginx (push) Waiting to run
CI/CD Pipeline for Frontend / build_and_push_frontend (push) Waiting to run
Tests / tests (client) (push) Waiting to run
Tests / tests (server) (push) Waiting to run
This commit is contained in:
commit
66d57fd451
4 changed files with 9 additions and 6 deletions
3
LICENSE
3
LICENSE
|
|
@ -1,6 +1,7 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2023 ETS-PFE004-Plateforme-sondage-minitest
|
Copyright (c) 2023 ETS-PFE004-Plateforme-sondage-minitest
|
||||||
|
Copyright (c) 2024 Louis-Antoine Caron, Mathieu Roy, Mélanie St-Hilaire, Samy Waddah
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -18,4 +19,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,13 @@ services:
|
||||||
frontend:
|
frontend:
|
||||||
image: fuhrmanator/evaluetonsavoir-frontend:latest
|
image: fuhrmanator/evaluetonsavoir-frontend:latest
|
||||||
container_name: frontend
|
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:
|
ports:
|
||||||
- "5173:5173"
|
- "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
|
restart: always
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ const cors = require("cors");
|
||||||
const bodyParser = require('body-parser');
|
const bodyParser = require('body-parser');
|
||||||
|
|
||||||
const configureServer = (httpServer, isDev) => {
|
const configureServer = (httpServer, isDev) => {
|
||||||
|
console.log(`Configuring server with isDev: ${isDev}`);
|
||||||
return new Server(httpServer, {
|
return new Server(httpServer, {
|
||||||
path: "/socket.io",
|
path: "/socket.io",
|
||||||
cors: {
|
cors: {
|
||||||
|
|
@ -68,7 +69,7 @@ const server = http.createServer(app);
|
||||||
|
|
||||||
console.log(`Environnement: ${process.env.NODE_ENV} (${isDev ? 'dev' : 'prod'})`);
|
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}`);
|
console.log(`Server configured with cors.origin: ${io.opts.cors.origin} and secure: ${io.opts.secure}`);
|
||||||
|
|
||||||
setupWebsocket(io);
|
setupWebsocket(io);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue