learn hapi ― Build a Rate Limiter: Disable Rate Limiting (Part 6 of 7)

Rate limiting is a security feature that comes with costs you need to manage. For example, once enabled, rate limiting applies to all requests going through your server. This can cause problems when using the rate limiter for both, APIs and web apps.

Sending requests to web applications will render and load the actual website which causes subsequent requests to load CSS, javascript, and images.

This may eat up your rate limit, especially during development. When thinking of testing, rate limiting can cause pains, too. Remember the rate limit configuration for the API login which allows ten requests per minute.

Running tests may send more than ten login requests and you can literally see the errors coming in. Also, it’s hard to debug and reproduce these situations because your coworker won't run into the rate limit on their first try.

That’s why you’ll integrate an option to enable or disable the plugin on startup or for individual routes.

The complete package code is available on GitHub in the hapi-rate-limitor repository and NPM at hapi-rate-limitor . Have a look!

To continue reading this premium tutorial go tofuturestud.io!

本文前端(javascript)相关术语:javascript是什么意思 javascript下载 javascript权威指南 javascript基础教程 javascript 正则表达式 javascript设计模式 javascript高级程序设计 精通javascript javascript教程

本文标题:learn hapi ― Build a Rate Limiter: Disable Rate Limiting (Part 6 of 7)

技术大类 技术大类 | 前端(javascript) | 评论(0) | 阅读(68)