stops logging metrics to localdb
This commit is contained in:
parent
75818e47fe
commit
6992b87033
2 changed files with 15 additions and 5 deletions
|
@ -20,10 +20,7 @@ const { setupBlockList } = require('./utils/blockList');
|
|||
const speechPassport = require('./speechPassport');
|
||||
const processTrending = require('./utils/processTrending');
|
||||
|
||||
const {
|
||||
logMetricsMiddleware,
|
||||
setRouteDataInContextMiddleware,
|
||||
} = require('./middleware/logMetricsMiddleware');
|
||||
const { setRouteDataInContextMiddleware } = require('./middleware/httpContextMiddleware');
|
||||
|
||||
const {
|
||||
details: { port: PORT, blockListEndpoint },
|
||||
|
@ -145,7 +142,7 @@ function Server() {
|
|||
|
||||
app[routeMethod](
|
||||
routePath,
|
||||
logMetricsMiddleware,
|
||||
// logMetricsMiddleware,
|
||||
setRouteDataInContextMiddleware(routePath, routeData),
|
||||
...controllers
|
||||
);
|
||||
|
|
13
server/middleware/httpContextMiddleware.js
Normal file
13
server/middleware/httpContextMiddleware.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
const httpContext = require('express-http-context');
|
||||
|
||||
function setRouteDataInContextMiddleware(routePath, routeData) {
|
||||
return function(req, res, next) {
|
||||
httpContext.set('routePath', routePath);
|
||||
httpContext.set('routeData', routeData);
|
||||
next();
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
setRouteDataInContextMiddleware,
|
||||
};
|
Loading…
Reference in a new issue