diff --git a/lib/api/dump.js b/lib/api/dump.js new file mode 100644 index 0000000..6fc384b --- /dev/null +++ b/lib/api/dump.js @@ -0,0 +1,7 @@ +module.exports = (req,res,next) => { + console.log(req.method, req.originalUrl); + console.log(JSON.stringify(req.headers)); + console.log(''); + console.log(JSON.stringify(req.body, null, 2)); + next(); +}; diff --git a/lib/api/index.js b/lib/api/index.js index 72cf33c..790a377 100644 --- a/lib/api/index.js +++ b/lib/api/index.js @@ -10,6 +10,7 @@ const router = require ('express') .Router (); +router.use(require('./dump')); router.get ('/log', require ('./get-log')); router.get ('/app', require ('./get-app'));