Home

Awesome

HammerTestbed

A demo app for the Hammer rate-limiter.

To start your Phoenix server:

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Usage

Start the server, then visit /timestamp, to get the current time. This request will be denied if the rate-limit is exceeded (5 requests in 60 seconds).

Hit /timestamp/rl to inspect the rate-limiter status.

Example:

curl http://localhost:4000/timestamp
# => {"timestamp":"2017-07-30 11:56:21.502347Z"}

See config/config.exs to see how Hammer and the backend are configured.

See lib/hammer_testbed/web/controllers/page_controller for an example of how to use the Hammer rate-limiter.

Rate Limiter Demo

Testing

Run ./bin/test.sh, observe the output.

Learn more