summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.PL7
-rw-r--r--README6
-rw-r--r--lib/Plack/Middleware/APIRateLimit.pm2
3 files changed, 10 insertions, 5 deletions
diff --git a/Makefile.PL b/Makefile.PL
index d83486c..c8d7db2 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,17 +1,18 @@
use inc::Module::Install;
name 'Plack-Middleware-APIRateLimit';
all_from 'lib/Plack/Middleware/APIRateLimit.pm';
+readme_from 'lib/Plack/Middleware/APIRateLimit.pm';
-# requires '';
+requires 'AnyEvent::Redis';
tests 't/*.t';
-author_tests 'xt';
author 'Franck Cuny';
license 'perl';
-readme_from 'lib/Plack/Middleware/APIRateLimit.pm';
build_requires 'Test::More';
use_test_base;
auto_include;
+author_tests 'xt';
+auto_set_repository;
WriteAll;
diff --git a/README b/README
index 5ab97aa..7f8bbe1 100644
--- a/README
+++ b/README
@@ -8,6 +8,9 @@ SYNOPSIS
enable "APIRateLimit", requests_per_hour => 2, backend => "Hash";
# or
enable "APIRateLimit", requests_per_hour => 2, backend => ["Redis", {port => 6379, server => '127.0.0.1'}];
+ # or
+ enable "APIRateLimit", request_per_hour => 2, backend => Redis->new(server => '127.0.0.1:6379');
+
sub { [ '200', [ 'Content-Type' => 'text/html' ], ['hello world'] ] };
};
@@ -30,7 +33,8 @@ DESCRIPTION
VARIABLES
backend
Which backend to use. Currently only Hash and Redis are supported.
- If no backend is specified, Hash is used by default.
+ If no backend is specified, Hash is used by default. Backend must
+ implement set, get and incr.
requests_per_hour
How many requests is allowed by hour.
diff --git a/lib/Plack/Middleware/APIRateLimit.pm b/lib/Plack/Middleware/APIRateLimit.pm
index 6a86446..8584416 100644
--- a/lib/Plack/Middleware/APIRateLimit.pm
+++ b/lib/Plack/Middleware/APIRateLimit.pm
@@ -173,7 +173,7 @@ How many requests is allowed by hour.
=head1 AUTHOR
-franck cuny E<lt>franck@linkfluence.netE<gt>
+franck cuny E<lt>franck@lumberjaph.netE<gt>
=head1 SEE ALSO