Permalink
Browse files

misc

  • Loading branch information...
1 parent 2509b5c commit 2deb39930a2be8513e885a2698fbceceb55b6a86 @tj tj committed Dec 18, 2011
Showing with 5 additions and 4 deletions.
  1. +4 −3 lib/ratelimit.js
  2. +1 −1 routes.js
View
@@ -2,15 +2,16 @@
var db = app.db;
/**
- * Limit `max` requests per 10 minutes.
+ * Limit `max` requests per `n` minutes.
*
* @param {Number} max
+ * @param {Number} mins
* @return {Function}
*/
-module.exports = function(max){
+module.exports = function(max, mins){
var min = 60
- , ttl = min * 10;
+ , ttl = min * mins;
return function(req, res, next){
var addr = req.socket.remoteAddress;
View
@@ -22,7 +22,7 @@ app.get('/', function(req, res, next){
* GET screenshot.
*/
-app.get('/', ratelimit(100), function(req, res, next){
+app.get('/', ratelimit(100, 10), function(req, res, next){
var url = req.query.url;
if (!url) return res.send(400);
var id = utils.md5(url);

0 comments on commit 2deb399

Please sign in to comment.