loopback-boot/test/helpers/push-name-middleware.js

9 lines
202 B
JavaScript

module.exports = function(name) {
return function(req, res, next) {
req._names = req._names || [];
req._names.push(name);
res.setHeader('names', req._names.join(','));
next();
};
};