senchalabs / connect

Connect is a middleware layer for Node.js
MIT License
9.84k stars 1.09k forks source link

Error while using express-rate-limit #1129

Closed a989898 closed 3 years ago

a989898 commented 3 years ago

When using express-rate-limit:

// express-rate-limit
const rateLimit = require('express-rate-limit');

const limiter = rateLimit({
    windowMs: 15 * 60 * 1000, // 15 minutes
    max: 100 // limit each IP to 100 requests per windowMs
  });

app.use(limiter());  //  apply to all requests
dougwilson commented 3 years ago

Hi @a989898 I took a look at that module and it uses some Express.js-specific API calls, so you would need to use it with Express.js and not with Connect.