📅  最后修改于: 2022-03-11 15:02:10.011000             🧑  作者: Mango
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);