1
0
mirror of synced 2025-12-21 10:57:10 -05:00
Files
docs/middleware/rate-limit.js
Vanessa Yuen 3df90fc9b8 Hello git history spelunker!
Are you looking for something? Here is all of the GitHub Docs history in one single commit. Enjoy! 🎉
2020-09-27 14:10:11 +02:00

11 lines
291 B
JavaScript

const rateLimit = require('express-rate-limit')
const isProduction = process.env.NODE_ENV === 'production'
module.exports = rateLimit({
// 1 minute (or 1ms outside of production)
windowMs: isProduction ? (60 * 1000) : 1,
// limit each IP to 1000 requests per windowMs
max: 1000
})