router.js
499 Bytes
/**
* router of sub app product
* @author: chen xuan<xuan.chen@yoho.cn>
* @date: 2016/07/19
*/
'use strict';
const Router = require('express').Router;
const cRoot = './controllers';
const productList = require(`${cRoot}/list`);
const router = Router();
// 商品列表
router.use('/list', (req, res, next) => {
req.module = 'product';
req.page = 'list';
next();
});
router.get('/list', productList.index);
router.post('/list', productList.getProducts);
module.exports = router;