@mantris/appify
Version:
Very opinionated Node.js API boilerplate as module.
17 lines (13 loc) • 341 B
JavaScript
const debug = require('debug')('appify:request')
const morgan = require('morgan')
/**
* @param {String} options.format Log format.
* @return {Function} Middleware.
*/
module.exports = ({ format }) => {
const stream = {
write: (string) => { debug(string.replace(/\n/, '')) }
}
return morgan(format, { stream })
}