servant-rate-limit-0.1.0.0: Rate limiting for Servant
Safe HaskellNone
LanguageHaskell2010

Servant.RateLimit

Description

This library implements Servant combinators for applying rate limiting strategies from Network.Wai.RateLimit.Strategy. Different strategies may be applied to different parts of the API. For example: @ import Servant.RateLimit

type TestAPI = RateLimit (FixedWindow 2 50) (IPAddressPolicy "fixed:") :> "fixed-window" :> Get '[JSON] String :| RateLimit (SlidingWindow 2 50) (IPAddressPolicy "sliding:") :> "sliding-window" :> Get '[JSON] String :| "unrestricted" :> Get '[JSON] String @

Documentation