index.ts
529 Bytes
import express from "express";
import socketIo from "socket.io";
import { createServer } from "http";
import { SocketHandler } from "./SocketHandler";
import { RoomManager } from "./room/RoomManager";
const PORT = 3000;
const app = express();
const server = createServer(app);
const io = new socketIo.Server(server);
const handler = new SocketHandler();
const roomManager = new RoomManager();
io.on("connection", (socket) => {
handler.connected(socket);
});
server.listen(PORT, () => console.log(`Listening on ${PORT}`));