index.js 506 Bytes
/**
 * some common api app
 * @author: jiangfeng<jeff.jiang@yoho.cn>
 * @date: 2016/08/22
 */

var express = require('express');

var app = express();

// set view engin

app.on('mount', function(parent) {
    delete parent.locals.settings; // 不继承父 App 的设置
    Object.assign(app.locals, parent.locals);
});

// for zookeeper, inject locals
app.use((req, res, next) => {
    req.app.locals.wap = app.locals.wap;

    next();
});

// router
app.use(require('./router'));

module.exports = app;