product.routes.js 484 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

이재연's avatar
zz    
이재연 committed
10
11
router.route('/getproduct/:category')
    .get(productCtrl.getlist)
이재연's avatar
dd    
이재연 committed
12
13
14

router.route('/getproduct/:subcategory')
    .get(productCtrl.subgetlist)
이재연's avatar
0113    
이재연 committed
15
16

router.param('category', productCtrl.categoryId)
이재연's avatar
dd    
이재연 committed
17
18

router.param('subcategory',productCtrl.subcategoryId)
Jiwon Yoon's avatar
Jiwon Yoon committed
19
    
Jiwon Yoon's avatar
Jiwon Yoon committed
20
export default router