REST endpoints: POST /lobbies, POST /lobbies/:code/join, GET /lobbies #31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Players need HTTP endpoints to create, join, and browse lobbies before establishing a WebSocket connection.
What to do
Add REST endpoints following the existing layered architecture: router > controller > service > model.
Files to create/change
apps/api/src/routes/lobbyRouter.ts— new file.apps/api/src/routes/apiRouter.ts— mount lobbyRouter on/lobbies.apps/api/src/controllers/lobbyController.ts— new file.apps/api/src/services/lobbyService.ts— new file.packages/db/src/models/lobbyModel.ts— new file.packages/shared/src/schemas/lobby.ts— new file. Zod schemas.Endpoint specs
Acceptance criteria
Notes
Follow patterns in
apps/api/src/controllers/gameController.tsandapps/api/src/services/gameService.ts. Code generation: adjective-number (WOLF-42) or 6-digit alphanumeric. Ensure uniqueness via DB constraint.