cart.routes.js 495 Bytes
Newer Older
1
2
3
4
5
6
import express from "express";
import cartCtrl from '../controllers/cart.controller.js';


const router = express.Router()

Jiwon Yoon's avatar
qwr    
Jiwon Yoon committed
7
router.route('/addcart')
Jiwon Yoon's avatar
Jiwon Yoon committed
8
    .put(cartCtrl.addCart)
Jiwon Yoon's avatar
qwr    
Jiwon Yoon committed
9
// .get()
10

Jiwon Yoon's avatar
qwr    
Jiwon Yoon committed
11
router.route('/showcart/:userId')
Jiwon Yoon's avatar
Jiwon Yoon committed
12
    .get(cartCtrl.showCart)
Jiwon Yoon's avatar
qwr    
Jiwon Yoon committed
13

Jiwon Yoon's avatar
Jiwon Yoon committed
14
15
router.route('/changecart')
    .post(cartCtrl.changeCart)
Jiwon Yoon's avatar
qwr    
Jiwon Yoon committed
16
17

router.route('/deletecart')
Jiwon Yoon's avatar
Jiwon Yoon committed
18
    .post(cartCtrl.deleteCart)
19
20
router.route('/deletecart2')
    .post(cartCtrl.deleteCart2)
Jiwon Yoon's avatar
Jiwon Yoon committed
21
22
23

router.param('userId', cartCtrl.userById)

24
export default router