Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brentgreeff/rails_rate_limiter
https://github.com/brentgreeff/rails_rate_limiter
Last synced: about 7 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/brentgreeff/rails_rate_limiter
- Owner: brentgreeff
- Created: 2018-05-14T07:25:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-19T07:35:46.000Z (almost 2 years ago)
- Last Synced: 2023-04-19T17:01:18.840Z (over 1 year ago)
- Language: Ruby
- Size: 44.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Challenge - Rate Limiter
Implement rate limiting on a route. Limit it such that a requester can only make:
100 requests per hour.
After the limit has been reached
-> return a 429 with the text"Rate limit exceeded. Try again in #{n} seconds".
## Redis server
redis://127.0.0.1:6379
Server url is currently hardcoded in config/environments/development.rb
## Run tests
Run `guard`
press [enter]
## Run locally
With httpie
`http GET localhost:3000/`
In bash to make 100 requests
```
for i in {1..100}
do
http GET localhost:3000/
done
```