learn hapi — Render a “Rate Limit Exceeded” View (Part 4 of 7)

Your rate limiter has a solid feature set: rate limit requests by IP address or a user identifier, allow dynamic rate limits and use a route-specific rate limit configuration. A missing feature is the support for web views. Up to this point, the rate limiter responds an error in JSON format.

After completing this tutorial, your rate limiter is able to respond with a “rate limit exceeded” HTML view besides the JSON response.

In case you want a helping hand on the code: the complete package is available on GitHub in the hapi-rate-limitor repository and on NPM at hapi-rate-limitor.

hapi Series Overview

  1. JWT Refresh Token for Multiple Devices (Coming soon)
  2. Check Refresh Token in Authentication Strategy (Coming soon)
  3. Rate Limit Your Refresh Token API Endpoint (Coming soon)


Continue reading

University Enrollment Required

Future Students benefit from value packed videos and tutorials.

Enroll to receive exclusive content or sign in if you’re already a Future Student.

Enroll me for $15/mo

Explore the Library

Find interesting tutorials and solutions for your problems.