express-route-stats

keep stats on route usage in express.js

express-route-stats

keep stats on route usage in express.js 3.x.x

example usage:

var express = require('express');
var app = express();
var collector = require('express-route-stats')(app);
 
app.use(collector.middleware());
 
app.get('/hello1', function(reqres){
  res.send('hello world');
});
 
app.get('/hello2', function(reqres){
  res.send('hello world');
});
 
app.get('/hello3/:id', function(reqres){
  res.send('hello world');
});
 
app.get('/seeit', function(reqres){
  // show the stats in api output 
  res.json(collector.getStats());
});
 
app.listen(3000);