import express from "express";
import type { Router } from "express";
import {
  createLobbyHandler,
  joinLobbyHandler,
} from "../controllers/lobbyController.js";
import { requireAuth } from "../middleware/authMiddleware.js";
import { lobbyLimiter } from "../middleware/rateLimiters.js";

export const lobbyRouter: Router = express.Router();

lobbyRouter.use(requireAuth);
lobbyRouter.use(lobbyLimiter);

lobbyRouter.post("/", createLobbyHandler);
lobbyRouter.post("/:code/join", joinLobbyHandler);
