todo.route.js 365 Bytes
Newer Older
Kim, Subin's avatar
Kim, Subin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import express from 'express';
import todoCtrl from "../controllers/todo.controller.js";

const router = express.Router();

router
    .route("/:userId")
    .get(todoCtrl.findbyId, todoCtrl.findbyDate, todoCtrl.send)
    .post(todoCtrl.create)
    .put(todoCtrl.edit)
    .delete(todoCtrl.remove)

router.param("userId", todoCtrl.getParams)

export default router;