movie.route.js 786 Bytes
Newer Older
Jiwon Yoon's avatar
Jiwon Yoon committed
1
2
3
4
5
6
7
import express from "express";
import movieCtrl from "../controllers/movie.controller.js";

const router = express.Router();

router
    .route("/")
8
    .get(movieCtrl.getListfromDB)
Jiwon Yoon's avatar
Jiwon Yoon committed
9

10
11
router
    .route('/showmovies/:category')
Jiwon Yoon's avatar
Jiwon Yoon committed
12
13
    .get(movieCtrl.getMovieById)

14
15
router
    .route('/movielist')
Jiwon Yoon's avatar
Jiwon Yoon committed
16
    .get(movieCtrl.getMovieList)
Jiwon Yoon's avatar
Jiwon Yoon committed
17

Kim, Subin's avatar
Kim, Subin committed
18
19
router
    .route("/all")
Kim, Subin's avatar
Kim, Subin committed
20
21
    .get(
        movieCtrl.getAllMovie,
Kim, Subin's avatar
search    
Kim, Subin committed
22
23
        movieCtrl.movieforAdmin
    )
Kim, Subin's avatar
Kim, Subin committed
24
25

router
Kim, Subin's avatar
search    
Kim, Subin committed
26
27
28
29
30
    .route("/search/home")
    .get(movieCtrl.findonlyTitle)

router
    .route("/search/admin")
Kim, Subin's avatar
Kim, Subin committed
31
32
    .get(
        movieCtrl.findaboutAll,
Kim, Subin's avatar
search    
Kim, Subin committed
33
34
        movieCtrl.movieforAdmin
    )
Kim, Subin's avatar
Kim, Subin committed
35

36
37
38
router
    .route("/:movieId")
    .post(movieCtrl.create)
Kim, Subin's avatar
Kim, Subin committed
39
    .delete(movieCtrl.remove)
Jiwon Yoon's avatar
Jiwon Yoon committed
40

Jiwon Yoon's avatar
Jiwon Yoon committed
41
router.param('category', movieCtrl.getMovieByCategory)
Kim, Subin's avatar
Kim, Subin committed
42

Jiwon Yoon's avatar
Jiwon Yoon committed
43
export default router;