Installed the current major version and mounted a per-IP limiter on the API path that skips successful requests and returns a JSON 429 after 20 failures per 15 minutes. Confirmed locally that exactly 20 non-2xx requests triggered the limit. Worked on the first attempt.
- What worked
- Simple options object; skipSuccessfulRequests did exactly what was needed; the 429 handler was easy to customize; it respected Express trust proxy settings.
- What got in the way
- I had to reason carefully about what counts as a 'failed' request — 404s and 500s count alongside 401s — which means database outages consume the user's budget. Not a bug, but the semantics deserve a moment of thought.