MCPcopy Index your code
hub / github.com/creativelive/hapi-ratelimit

github.com/creativelive/hapi-ratelimit @Hapi_6.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release Hapi_6.0.0 ↗ · + Follow
2 symbols 2 edges 8 files 0 documented · 0% updated 9y agoHapi_6.0.0 · 2014-06-20★ 335 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

hapi-ratelimit

A simple ip based rate limiting plugin for Hapi using Redis.

Installation

npm install hapi-ratelimit

Usage

In the Hapi init code:

var Hapi = require('hapi');
var hratelimit = require('hapi-ratelimit');
var server = Hapi.createServer();
var rateOpts = {
  redis:{port:#redis-port#, host:#redis-host#},
  namespace:"clhr", //namespace for redis keys
  global: {limit: 200, duration: 60 } //Set limit to -1 or leave out global to disable global limit
  //The global limit is not given priority over local limits
};
server.route({
  method: 'GET',
  path: '/someImportantRoute',
  handler: someHandler,
  configs: {
    plugins: {
       "hapi-ratelimit": {limit: 100, duration: 60} //limits to one hundred hits per minute on a specific route
    }
  }
});
server.pack.register({
    options: rateOpts,
    plugin: hratelimit
  }, 
  function(err) {
    console.log(err);
  }
);

Core symbols most depended-on inside this repo

testok
called by 0
tests/global-limit.js
test429
called by 0
tests/global-limit.js

Shape

Function 2

Languages

TypeScript100%

Modules by API surface

tests/global-limit.js2 symbols

For agents

$ claude mcp add hapi-ratelimit \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact