How to debug express router
The problem is caused by this:
> typeof express.Router()'function'
This makes Winston (your logger) think that router
is a callback function (which it isn't), and calls it with incorrect arguments that make router
throw an error.
I'm not sure exactly why you want to log router
, but if you want to debug Express, you can read this.