You can generate quite a detailed trace of what Express does by running Notes this way:
$ DEBUG=express:* npm start
This is pretty useful if you want to debug Express. But, we can use this in our own code as well. It is similar to inserting console.log statements, but without having to remember to comment out the debugging code.
It is very simple to enable debugging in a module:
const debug = require('debug')('module-name'); .. debug('some message'); .. debug(`got file ${fileName}`);