mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
isDev n'était pas passé en paramètre (undefined)
This commit is contained in:
parent
7c5c6739fa
commit
afef820765
1 changed files with 2 additions and 1 deletions
|
|
@ -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