Throttle setting (speed limiter) with update for some endpoints, such as.
var rateLimit = restify.throttle({burst:100,rate:50,ip:true}); server.get('/my/endpoint', rateLimit, function(req, res, next) { // Do something here return next(); } ); server.post('/another/endpoint', rateLimit, function(req, res, next) { // Do something here return next(); } );
Or like that.
server.post('/my/endpoint', restify.throttle({burst:100,rate:50,ip:true}), function(req, res, next) {
Even when throttling to an endpoint, a global throttle may be required, so this can be done as follows.
server.use(restify.throttle({burst:100,rate:50,ip:true});
(link) Throttle is one way to validate Bundled-Plugins .
Mark maruska
source share