Authored by 郭成尧

add-isApmReport

Showing 1 changed file with 4 additions and 5 deletions
... ... @@ -104,19 +104,18 @@ app.use(compression());
require('./doraemon/middleware/yoho-session')(app);
// 添加请求上下文
app.use(global.yoho.httpCtx());
app.use((req, res, next) => {
req.user = {}; // 全局的用户数据
req.yoho = {}; // req和res绑定yoho对象,用于传递全局数据, 如req.yoho.channel等
req.app.locals.wap = app.locals.wap; // zookeper对象赋值
req.isApmReport = app.locals.wap.open.bughd; // 把错误上报的开关绑定到上下文,node-lib 库要使用
next();
});
// 添加请求上下文
app.use(global.yoho.httpCtx());
// redis seo
// dispatcher
try {
const tdkUrl = require('./doraemon/middleware/redis-url');
... ...