Plug.Ratelimit (plug_ratelimit v0.21.39)

A plug that enforces rate limiting (requests per second)

Use in your Router:

plug(Plug.Ratelimit, requests_per_second: 4)

Link to this section Summary

Functions

MUST have a keyword of the form

Link to this section Functions

Link to this function

call(conn, list)

MUST have a keyword of the form:

[requests_per_second: x]

where x is a positive integer.

MAY override the response message with:

[..., message: "Enhance Your Calm"]