UNPKG

http-simple-proxy

Version:

Simple http/https proxy daemon. Proxying based on the excellent node-http-master.

15 lines (13 loc) 377 B
var morgan = require('morgan'); module.exports = function LogMiddleware(logFileService) { return { requestHandler: function(req, res, next, middlewareInstance) { middlewareInstance(req, res, next); }, entryParser: function(entry) { return morgan(entry.type || 'combined', { stream: logFileService(entry.file || entry) }); } }; };