spee.ch/server/middleware/httpContextMiddleware.js

14 lines
322 B
JavaScript
Raw Permalink Normal View History

2019-06-05 16:08:13 +02:00
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,
};