refactor: debut de la refactorisation du projet

This commit is contained in:
2026-08-01 14:13:28 +02:00
parent 32b042b72c
commit c709064062
17 changed files with 120 additions and 115 deletions

19
server.js Normal file
View File

@@ -0,0 +1,19 @@
const express = require("express");
const path = require("path");
const http = require("http");
const { Server } = require("socket.io");
const { PORT } = require("./config");
const { registerSocketHandlers } = require("./socketHandlers");
const app = express();
const server = http.createServer(app);
const wSS = new Server(server); // wSS pour webSocketServer
app.use(express.static(path.join(__dirname, "..", "client")));
wSS.on("connection", (socket) => registerSocketHandlers(wSS, socket));
server.listen(PORT, () => {
console.log(`serveur demarre sur http://localhost:${PORT}`);
});