Ajout du dossier 'routes'

This commit is contained in:
Rampeur
2025-08-10 09:16:54 +02:00
parent b68dd4c800
commit 2f78d85a27
8 changed files with 149 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
const express = require("express");
const router = express.Router();
const {
getComment,
getComments,
createComment,
deleteComment,
} = require("../../controllers/comments");
const { protect } = require("../../middlewares/auth");
router
.route("/articles/:slug/comments")
.get(protect, getComments)
.post(protect, createComment);
router
.route("/articles/:slug/comments/:id")
.get(protect, getComment)
.delete(protect, deleteComment);
module.exports = router;