movie.route.js 782 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("/")
Jiwon Yoon's avatar
Jiwon Yoon committed
8
9
// .post(movieCtrl.comparePopularMovie)

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

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

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

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

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

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

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

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