Files
dflike/server/src/main.ts
T

15 lines
420 B
TypeScript

import http from 'http';
import { GameLoop } from './game/GameLoop.js';
import { SocketServer } from './network/SocketServer.js';
const PORT = process.env.PORT ? parseInt(process.env.PORT) : 3001;
const gameLoop = new GameLoop();
const httpServer = http.createServer();
new SocketServer(httpServer, gameLoop);
httpServer.listen(PORT, () => {
console.log(`Server listening on port ${PORT}`);
gameLoop.start();
});