Heyyy 👋🏻 ! My name is Christian, an Agile Software Developer, living in Trento (IT).
I am currently working at Wonderflow.
You can read more about me.

How to use morgan with node-simple-router


Share on Twitter

You can use it like a middleware as it is supposed to be used in combination with router.any to log any reqeust of the web server.

Here a simple example:

var http = require('http')
  , router = require('node-simple-router')()
  , morgan = require('morgan')
  , logger = morgan('combined')


router.get('/hook',function(req, res) {
  res.end('incoming hook')