Authored by htoooth

fix apm bug

... ... @@ -71,6 +71,14 @@ app.set('json replacer', function(key, value) {
return value;
});
app.use((req, res, next) => {
req.isApmReport = _.get(req.app.locals, 'pc.open.bughd', false);
next();
});
// 添加请求上下文
app.use(global.yoho.httpCtx());
// 请求限制中间件
if (!app.locals.devEnv) {
app.use(require('./doraemon/middleware/limiter'));
... ... @@ -79,9 +87,6 @@ if (!app.locals.devEnv) {
// 指定libray目录
global.utils = path.resolve('./utils');
// 添加请求上下文
app.use(global.yoho.httpCtx());
// 访问域名层级
app.set('subdomain offset', 3);
... ... @@ -105,9 +110,6 @@ 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等
... ...
... ... @@ -73,7 +73,7 @@
"xml2js": "^0.4.19",
"yoho-express-session": "^2.0.0",
"yoho-md5": "^2.0.0",
"yoho-node-lib": "=0.5.29",
"yoho-node-lib": "=0.5.30",
"yoho-zookeeper": "^1.0.8"
},
"devDependencies": {
... ...