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

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.