spee.ch/server/middleware/httpContextMiddleware.js
2019-06-05 10:08:13 -04:00

13 lines
322 B
JavaScript

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