···11-import dotenv from "dotenv"
22-import app from "./app.js"
3144-dotenv.config()
22+import dotenv from "dotenv";
33+import app from "./app.js";
44+import http from "http";
55+import webSocketServer from "./webSocket.js";
5666-const PORT = process.env.PORT || 5000
77+dotenv.config();
7888-app.listen(PORT, () => {
99- console.log(`🚀 Server running on http://localhost:${PORT}`)
1010-})
99+const PORT = process.env.PORT || 3000;
1010+1111+// Create a single HTTP server
1212+const server = http.createServer(app);
1313+1414+// Attach WebSocket server to the same HTTP server
1515+webSocketServer(server);
1616+1717+// Start listening
1818+server.listen(PORT, () => {
1919+ console.log(`🚀 Server running on http://localhost:${PORT}`);
2020+});
1121