Super tiny helper middleware for slowing down requests. Use for your testing.
npm install express-simple-throttler
The middleware comes in two flavors, constant and random.
const throttler = require('express-throttler');
const app = require('express')();
const twentySeconds = 20 * 1000;
app.use(throttler(twentySeconds));
// Setup your routes, now they are all super slow
// ...
const throttler = require('express-throttler');
const app = require('express')();
const upToTwentySeconds = 20 * 1000;
app.use(throttler(upToTwentySeconds, true));
// Setup your routes, now some may be super slow
// ...
Tests are run with jasmine through the test command as follows:
npm test