Sha256: de967a9bb9b3698f01ef195cff6a572a977ad3fb0c43a4ae69d9cab9319ad13a

Contents?: true

Size: 355 Bytes

Versions: 2

Compression:

Stored size: 355 Bytes

Contents

require 'rack/congestion'

# Limit requests to
#   - a global maximum of 10 requests per minute
#   - a maximum of 1 request per minute per user
use Rack::Congestion::Limiter,   interval: 60, max_in_interval: 10
use Rack::Congestion::IpLimiter, interval: 60, max_in_interval: 1

run ->(env){
  [200, { 'Content-Type' => 'text/plain' }, ['Hello world']]
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rack-congestion-0.0.3 examples/per_ip_and_global.ru
rack-congestion-0.0.2 examples/per_ip_and_global.ru