Skip to content

Instantly share code, notes, and snippets.

@rasputnik
Created September 4, 2010 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rasputnik/565169 to your computer and use it in GitHub Desktop.
Save rasputnik/565169 to your computer and use it in GitHub Desktop.
module.exports = function counterSetup(logcheckpoint) {
var hitcount = 0;
var logcheckpoint = logcheckpoint || 1000;
return function hitCount(req, res, next) {
hitcount++;
if (hitcount % logcheckpoint == 0 ) {
console.log(hitcount + " hits");
}
next();
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment