product.routes.js 671 Bytes
Newer Older
Jiwon Yoon's avatar
Jiwon Yoon committed
1
2
3
import express from "express";
import productCtrl from '../controllers/product.controller.js';

kusang96's avatar
kusang96 committed
4

Jiwon Yoon's avatar
Jiwon Yoon committed
5
6
7
const router = express.Router()

router.route('/regist')
kusang96's avatar
dd    
kusang96 committed
8
    .post(productCtrl.imageUpload, productCtrl.regist)
이재연's avatar
0113    
이재연 committed
9

kusang96's avatar
0115    
kusang96 committed
10
11
12
router.route('/getproduct')
    .get(productCtrl.getToHome)

kusang96's avatar
kusang96 committed
13
14
15
router.route('/getproduct/all')
    .get(productCtrl.getAll)

박상호's avatar
박상호 committed
16
router.route('/getproduct/main/:category')
이재연's avatar
0113    
이재연 committed
17
18
    .get(productCtrl.getlist)

박상호's avatar
박상호 committed
19
20
router.route('/getproduct/sub/:subname')
    .get(productCtrl.subname)
이재연's avatar
0113    
이재연 committed
21

22
23
router.route('/pluspurchase')
    .post(productCtrl.plusPurchase)
이재연's avatar
dd    
이재연 committed
24

25
router.param('category', productCtrl.categoryId)
박상호's avatar
박상호 committed
26
router.param('subname',productCtrl.subcategoryId)
Jiwon Yoon's avatar
Jiwon Yoon committed
27
    
Jiwon Yoon's avatar
Jiwon Yoon committed
28
export default router