diff options
author | Julien Dessaux | 2022-11-22 22:55:36 +0100 |
---|---|---|
committer | Julien Dessaux | 2022-11-22 22:55:36 +0100 |
commit | 038c877aed55cffdb4401a4c7e7b15b113798145 (patch) | |
tree | e2902779e76ba8bd60b63be0e512a3c112530d68 /routes/games.js | |
parent | Added basic games handling (diff) | |
download | jeux-de-mots-038c877aed55cffdb4401a4c7e7b15b113798145.tar.gz jeux-de-mots-038c877aed55cffdb4401a4c7e7b15b113798145.tar.bz2 jeux-de-mots-038c877aed55cffdb4401a4c7e7b15b113798145.zip |
Implemented game creation
Diffstat (limited to 'routes/games.js')
-rw-r--r-- | routes/games.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/routes/games.js b/routes/games.js index 67d105d..3a27cdb 100644 --- a/routes/games.js +++ b/routes/games.js @@ -1,15 +1,18 @@ import express from "express"; import { gameId_get } from "../controllers/games/gameId.js"; -import { root_get } from "../controllers/games/root.js"; +import { root_get, root_post } from "../controllers/games/root.js"; +import bodyParser from "../middlewares/formParser.js"; import requireAuth from "../middlewares/requireAuth.js"; import session from "../middlewares/sessions.js"; +import { checkName, checkUsername } from "../utils/checks.js"; const router = express.Router(); router.use(session); router.use(requireAuth); router.get("/", root_get); +router.post("/", [bodyParser, checkName, checkUsername], root_post); router.get("/:gameId(\\d+)", gameId_get); export default router; |