...
|
...
|
@@ -26,6 +26,7 @@ const uuid = require('uuid'); |
|
|
const pkg = require('./package.json');
|
|
|
const hbsEvent = require('./config/hbsevent');
|
|
|
const _ = require('lodash');
|
|
|
const stringProcess = require('./utils/string-process');
|
|
|
|
|
|
const app = express();
|
|
|
|
...
|
...
|
@@ -56,6 +57,7 @@ app.enable('trust proxy'); |
|
|
app.disable('x-powered-by');
|
|
|
|
|
|
app.use((req, res, next) => {
|
|
|
req.url = stringProcess.decodeURIComponent(req.url) || '/404';// 错误的网址编码重定向404
|
|
|
req.isApmReport = _.get(req.app.locals, 'wap.open.bughd', false); // 把错误上报的开关绑定到上下文,node-lib 库要使用
|
|
|
next();
|
|
|
});
|
...
|
...
|
@@ -189,4 +191,3 @@ app.listen(config.port, function() { |
|
|
}
|
|
|
});
|
|
|
}); |
|
|
|
...
|
...
|
|