📜  一起使用 chalk 和 morgan - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:35.940000             🧑  作者: Mango

代码示例1
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))
}))