router.js
832 Bytes
/**
* router of sub app partial
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2016/06/30
*/
'use strict';
const router = require('express').Router(); // eslint-disable-line
const cRoot = './controllers';
const list = require(cRoot + '/list');
const item = require(cRoot + '/item');
const fav = require(cRoot + '/favorite');
const shop = require(cRoot + '/shop');
const query = require(cRoot + '/query');
// Your controller here
router.get('/list', list.index); // 列表页面
router.get('/list/new', list.newPage); // 新品列表页
router.get(/\/pro_([\d]+)_([\d]+)\/(.*)/, item.index); // 商品详情routers
router.post('/item/togglecollect', fav.product); // 商品详情页
router.get('/shop/:domain/list', shop.list);
router.get('/shop/:domain', shop.index);
router.get('/query', query.index);
module.exports = router;