stops logging metrics to localdb #1013

Merged
jessopb merged 1 commit from noMetrics into master 2019-06-05 17:02:09 +02:00
2 changed files with 15 additions and 5 deletions

View file

@ -20,10 +20,7 @@ const { setupBlockList } = require('./utils/blockList');
const speechPassport = require('./speechPassport'); const speechPassport = require('./speechPassport');
const processTrending = require('./utils/processTrending'); const processTrending = require('./utils/processTrending');
const { const { setRouteDataInContextMiddleware } = require('./middleware/httpContextMiddleware');
logMetricsMiddleware,
setRouteDataInContextMiddleware,
} = require('./middleware/logMetricsMiddleware');
const { const {
details: { port: PORT, blockListEndpoint }, details: { port: PORT, blockListEndpoint },
@ -145,7 +142,7 @@ function Server() {
app[routeMethod]( app[routeMethod](
routePath, routePath,
logMetricsMiddleware, // logMetricsMiddleware,
setRouteDataInContextMiddleware(routePath, routeData), setRouteDataInContextMiddleware(routePath, routeData),
...controllers ...controllers
); );

View 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,
};