pomelo-http-plugin
Version:
Wrap express module as pomelo http plugin.
18 lines (14 loc) • 370 B
JavaScript
;
module.exports = function() {
return new LogFilter();
}
var LogFilter = function(plugin) {
}
LogFilter.prototype.before = function(req, res, next) {
console.log('[http request]:', req.method, req.url);
next();
}
LogFilter.prototype.after = function(req, res, next) {
console.log('[http response]:', req.method, req.url, res.get('resp'));
next();
}