product.routes.js 673 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
0113    
이재연 committed
16
17
18
router.route('/getproduct/:category')
    .get(productCtrl.getlist)

이재연's avatar
dd    
이재연 committed
19
20
router.route('/getproduct/:subcategory')
    .get(productCtrl.subgetlist)
이재연'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
dd    
이재연 committed
26
router.param('subcategory',productCtrl.subcategoryId)
Jiwon Yoon's avatar
Jiwon Yoon committed
27
    
Jiwon Yoon's avatar
Jiwon Yoon committed
28
export default router