const express = require("express"); const app = express(); const http = require("http").Server(app); const io = require("socket.io")(http); const port = 8081; app.use(express.static("public")); http.listen(port, () => { console.log(`Listening on http://localhost:${port}`); }); app.get("/", (req, res) => { res.sendFile(path.join(__dirname, "/public/index.html")); }); module.exports = { io, };