How to use the throttle function from restify

Find comprehensive JavaScript restify.throttle code examples handpicked from public code repositorys.

59
60
61
62
63
64
65
66
67
68
69
  username: true
};


var plugins = [
  restify.acceptParser(server.acceptable),
  restify.throttle(throttleOptions),
  restify.dateParser(),
  restify.queryParser(),
  restify.fullResponse()
];
fork icon25
star icon70
watch icon0

59
60
61
62
63
64
65
66
67
68
  username: true
};

var plugins = [
  restify.acceptParser( server.acceptable ),
  restify.throttle( throttleOptions ),
  restify.dateParser(),
  restify.queryParser(),
  restify.fullResponse(),
];
fork icon5
star icon3
watch icon9

328
329
330
331
332
333
334
335
336
337
// Set a per request pino logger (with requestid filled in)
server.use(restify.requestLogger());

// Allow 5 requests/second by IP, and burst to 10
server.use(
    restify.throttle({
        burst: 10,
        rate: 5,
        ip: true
    })
fork icon0
star icon2
watch icon0

+ 3 other calls in file