RailsApiGuard
A pluggable, configurable rate limiting middleware for Rails APIs with Redis backend, Slack alerts, and endpoint exclusions.
🚀 Installation
Add this line to your application's Gemfile:
gem 'rails_api_guard'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install rails_api_guard
Generate the Initializer
rails generate rails_api_guard:install
Middleware
Add this to application.rb if not used generator
config.middleware.use RailsApiGuard::Middleware::RateLimiter
Configuration
Edit config/initializers/rails_api_guard.rb
to set request limits, expiry time, Slack alerts, and excluded endpoint patterns.
Contributing
Contribution directions are yet to add.
License
The gem is available as open source under the terms of the MIT License.