stops logging metrics to localdb

This commit is contained in:
Jessop Breth 2019-06-05 10:08:13 -04:00
parent 75818e47fe
commit 6992b87033
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 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
);

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