micro-visualize
v3.0.1
Published
Visualize requests in micro
Downloads
18
Maintainers
Readme
micro-visualize
Visualizes requests and responses for services written with micro
.
Screenshot
Installation
npm install --save micro-visualize
Or even better
yarn add micro-visualize
Import and Usage Example
const visualize = require('micro-visualize')
module.exports = visualize(async function (req, res) {
return 'Hello, world!'
})
API
visualize
Visualize requests and responses for a given function. The function is a no-op if log
is not dev
.
Parameters
Examples
const visualize = require('micro-visualize')
module.exports = visualize(async function (req, res) {
return 'Hello, world!'
})
const visualize = require('micro-visualize')
// Will only visualize requests/responses if
// ``process.env.NODE_ENV`` is ``dev``
module.exports = visualize(async function (req, res) {
return 'Hello, world!'
}, process.env.NODE_ENV)
Returns an async Function.
Credits
Thanks to @rickharrison for his excellent PR which this project was heavily based on.