dispatch.js 673 Bytes
/**
 * 路由分发
 *
 * @author: Aiden Xu<aiden.xu@yoho.cn>
 * @date: 2016/4/27
 */
const channelGender = require('./doraemon/middleware/channel-gender').channelGender;

module.exports = app => {
    app.use('/', require('./apps/channel')); // 一级频道模块
    // 商品模块
    app.use('/'
        , channelGender
        , require('./apps/product')
    );
    app.use('/', require('./apps/me')); // 个人中心
    app.use('/api', require('./apps/api')); // 各模块公有 API
    app.use('/editorial', require('./apps/editorial')); // 资讯

    // 组件示例
    if (!app.locals.proEnv) {
        app.use('/example', require('./apps/example'));
    }
};