Ajout du dossier 'routes'
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user