summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-04-27 18:48:15 +0200
committerfranck cuny <franck@lumberjaph.net>2010-04-27 18:48:15 +0200
commitf194b9e308061581459f9bb7fa94e36fd176eec6 (patch)
treec986f364140aeb64b8b8945c76accbb9f1d4ab06 /README
parentchange how path works, by default the whole application is throttled, but if ... (diff)
downloadplack-middleware-throttle-f194b9e308061581459f9bb7fa94e36fd176eec6.tar.gz
new readme
Diffstat (limited to 'README')
-rw-r--r--README11
1 files changed, 8 insertions, 3 deletions
diff --git a/README b/README
index 7c541d7..9da20a3 100644
--- a/README
+++ b/README
@@ -6,7 +6,8 @@ SYNOPSIS
my $handler = builder {
enable "Throttle::Hourly",
max => 2,
- backend => Plack::Middleware::Throttle::Backend::Hash->new();
+ backend => Plack::Middleware::Throttle::Backend::Hash->new(),
+ path => qr{^/foo};
sub { [ '200', [ 'Content-Type' => 'text/html' ], ['hello world'] ] };
};
@@ -35,7 +36,7 @@ OPTIONS
message
HTTP message returned in the response when the limit have been
- exceeded. By defaylt "Over rate limit"
+ exceeded. By defaylt "Over rate limit".
backend
A cache object to store sessions informations.
@@ -50,7 +51,11 @@ OPTIONS
default, you can use "Plack::Middleware::Throttle::Backend::Hash".
key_prefix
- Key to prefix sessions entry in the cache
+ Key to prefix sessions entry in the cache.
+
+ path
+ URL pattern or a callback to match request to throttle. If no path
+ is specified, the whole application will be throttled.
white_list
An arrayref of hosts to put in a white list.