hapi-api-rate-limit

1.0.0 • Public • Published

hapi-api-rate-limit

Redis api rate limit plugin for hapi

Dependency Status

NPM

Usage

To use default settings simply write:

var Hapi = require('hapi');
var server = new Hapi.Server();
 
 
server.pack.register(require('hapi-api-rate-limit'), function (err) {
    // plugin is loaded
});
 

If you want to overwrite the default settings:

var Hapi = require('hapi');
var server = new Hapi.Server();
 
var options = {
    interval: 10, // seconds
    requestLimit: 1 // 1 request per interval
};
 
server.pack.register({
    plugin: require('hapi-api-rate-limit'),
    options: options
}, function (err) {
    // plugin is loaded
});
 

License

MIT

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i hapi-api-rate-limit

    Weekly Downloads

    3

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • glaubinix