product.routes.js 727 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
const router = express.Router()

이재연's avatar
이재연 committed
7
8
9
router.route('/sort')
    .get(productCtrl.Sortlist)

Jiwon Yoon's avatar
Jiwon Yoon committed
10
router.route('/regist')
kusang96's avatar
dd    
kusang96 committed
11
    .post(productCtrl.imageUpload, productCtrl.regist)
이재연's avatar
0113    
이재연 committed
12

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

kusang96's avatar
kusang96 committed
16
17
18
router.route('/getproduct/all')
    .get(productCtrl.getAll)

이재연's avatar
0113    
이재연 committed
19
20
21
router.route('/getproduct/:category')
    .get(productCtrl.getlist)

이재연's avatar
dd    
이재연 committed
22
23
router.route('/getproduct/:subcategory')
    .get(productCtrl.subgetlist)
이재연's avatar
0113    
이재연 committed
24

25
26
router.route('/pluspurchase')
    .post(productCtrl.plusPurchase)
이재연's avatar
dd    
이재연 committed
27

28
router.param('category', productCtrl.categoryId)
이재연's avatar
dd    
이재연 committed
29
router.param('subcategory',productCtrl.subcategoryId)
Jiwon Yoon's avatar
Jiwon Yoon committed
30
    
Jiwon Yoon's avatar
Jiwon Yoon committed
31
export default router