user.route.ts 417 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
import express from "express";
import { userCtrl, authCtrl } from "../controllers";

const router = express.Router();

router
  .route("/")
  .get(authCtrl.requireLogin, userCtrl.getUsers)
  .post(authCtrl.requireLogin, userCtrl.createUser);

Yoon, Daeki's avatar
Yoon, Daeki committed
11
12
13
14
15
16
router
  .route("/:userId")
  .delete(authCtrl.requireLogin, authCtrl.authenticate, userCtrl.deleteUser);

router.param("userId", userCtrl.userById);

17
export default router;