Skip to content

Fix code scanning alert - Missing rate limiting #6

@yechielb2000

Description

@yechielb2000

Check why express-rate-limit doesn't work.
I use it as a middleware but still doesn't work, here is the code :

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

app.use(
  rateLimit ({
  windowMs: 60 * 1000,
  max: 5,
  handler: function (req, res) {
    return res.status(429).json({
      error: 'You sent too many requests. Please wait a while then try again'
    })
  }
}));

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions