Authored by weiqingting

腾讯云 preview

... ... @@ -14,6 +14,8 @@ var config = require('./config/common');
var util = require('./util/common');
var multipart = require('connect-multiparty');
var env = process.env.NODE_ENV || 'development';
var options = {
//初始化yo的app
... ... @@ -34,6 +36,10 @@ var options = {
beforeMid:function(app,mids) {//使用handlebars-layouts
require('handlebars-layouts').register(mids.hbs.handlebars);
app.use(multipart());
if (env === 'preview') {
//静态目录
app.use(express.static(options.envStatic.preview));
}
},
beforeCustMid: function (app, routers) {
app.use(auth);//权限验证
... ...