Logging with visualization middleware for use with node.js
const nodeSpy = require('nodeSpy');
In addition to requiring the nodeSpy module, install Express globally to enable the use of two servers.
Start up the nodeSpy server that serves spy data when called on to report. Specify port as a parameter.
// listening on port 3030
nodeSpy.server(3030);
Place spy middleware between other middleware to log changes between response and request.
Place report middleware after all spy instances to summarize report on separate app.
const express = require('express');
const nodeSpy = require('nodeSpy');
const app = express();
nodeSpy.server(3030);
app.get('/getUsers', nodeSpy.log, other.middleware, nodeSpy.report);