express-status-counter
v0.1.0
Published
express middleware that counts response by the first digit of its HTTP status codes
Downloads
2
Maintainers
Readme
express-status-counter
express middleware that counts response by the first digit of its HTTP status codes.
Install
› npm install -S express-status-counter
Usage
// server.js
var connect = require('connect'),
statusCounterMiddleware = require('express-status-counter'),
stats = require('luster').stats;
var app = connect()
// Every response will be counted by `stats` function as `app.stats.status-<N>xx`,
// where `N` is the first digit of HTTP status code.
app.use(statusCounterMiddleware(stats, function getStatusNamePrefix(req) {
return 'app.stats.status';
}));