movie.route.js 763 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
search    
Kim, Subin committed
18
19
20
    .get(movieCtrl.getAllMovie,
        movieCtrl.movieforAdmin
    )
Kim, Subin's avatar
Kim, Subin committed
21
22

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

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

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

Jiwon Yoon's avatar
Jiwon Yoon committed
37
router.param('category', movieCtrl.getMovieByCategory)
Jiwon Yoon's avatar
Jiwon Yoon committed
38
export default router;