dispatch.js 714 Bytes
/**
 * API路由分发
 * @author: Leo <qi.li@yoho.cn>
 * @date: 2017/6/23
 */
const api = require('./apps/api');
const admin = require('./apps/admin');
const article = require('./apps/article');
const user = require('./apps/user');
const passport = require('./apps/passport');
const activity = require('./apps/activity');
const authAdmin = require('./doraemon/middleware/authAdmin');

module.exports = app => {
    // api
    app.use('/api', api);

    // 管理
    app.use('/admin', authAdmin, admin);

    // 验证
    app.use('/passport', passport);

    // 文章
    app.use('/article', article);

    // 用户相关
    app.use('/user', user);

    // 活动服务
    app.use('/activity', activity);
};