import { createServer } from "http";
import { createApp } from "./app.js";
import { setupWebSocket } from "./ws/index.js";

const PORT = Number(process.env["PORT"] ?? 3000);

const app = createApp();
const server = createServer(app);

setupWebSocket(server);

server.listen(PORT, () => {
  console.log(`Server listening on port ${PORT}`);
});
