Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

using chalk and morgan together

var chalk = require('chalk')
var morgan = require('morgan')

app.use(morgan(function (tokens, req, res) {
  return chalk.blue(tokens.method(req, res))
    + ' ' + chalk.green(tokens.url(req, res))
    + ' ' + chalk.red(tokens['response-time'](req, res))
}))
Source by github.com #
 
PREVIOUS NEXT
Tagged: #chalk #morgan
ADD COMMENT
Topic
Name
4+1 =