From fd85e05cfd0595ddf3c548350452f2b9bad12dc7 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sat, 10 Jun 2023 03:11:09 +0200 Subject: [PATCH] Updated the index.js --- server/index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/index.js b/server/index.js index 49cd7cc..3c81890 100644 --- a/server/index.js +++ b/server/index.js @@ -1,7 +1,15 @@ const express = require("express"); - +const { Server } = require("socket.io"); +const http = require("http"); const app = express(); -app.listen(5287, () => { +app.disable("x-powered-by"); + +const server = http.createServer(app); +const io = new Server(server); + +io.on("connection", require("./handler/connection")); + +server.listen(5287, () => { console.log("Server running on port 5287"); }); \ No newline at end of file