movie.route.js 665 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
Kim, Subin's avatar
Kim, Subin committed
12
    .route('/movielist/:category')
Jiwon Yoon's avatar
Jiwon Yoon committed
13
    .get(movieCtrl.getMovieList)
Jiwon Yoon's avatar
Jiwon Yoon committed
14

Kim, Subin's avatar
Kim, Subin committed
15
16
router
    .route("/all")
Kim, Subin's avatar
Kim, Subin committed
17
18
    .get(
        movieCtrl.getAllMovie,
Kim, Subin's avatar
search    
Kim, Subin committed
19
20
        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
    .route("/search/home")
    .get(movieCtrl.findonlyTitle)

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

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

Kim, Subin's avatar
Kim, Subin committed
38

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