fh-request-timer
v1.0.1
Published
Express middleware to add a timer to all requests, sending the result to RHMAP stats and optionally adding the time taken as a response header
Downloads
10
Maintainers
Readme
fh-request-timer
A simple request timer middleware for express apps that logs request time to the
Red Hat Mobile Application Platform, as well as adding an optional x-fh-timer
header to
each response.
Implementation
// require module
var reqTimer = require('fh-request-timer');
// include timer middleware
app.use(reqTimer());
Configuration
To remove the x-fh-timer
from the response, pass the option {addHeader:false}
when calling the middleware:
// include timer middleware
app.use(reqTimer({addHeader: false}));
Run Unit Tests
npm install
npm test