📜  基于 ip 的快速限制 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:43.809000             🧑  作者: Mango

代码示例1
const rateLimit = require('express-rate-limit');

const limiter = rateLimit({
  max: 100,
  windowMs: 60 * 60 * 1000,
  message: 'too many requests sent by this ip, please try again in an hour !'
});

app.use('', limiter);  // eg: app.use('/api', limiter);