Im wondering if user has no wifi and is only using his cellular network on his mobile device, the rate limiting will work / will there be a req.ip ?
const rateLimit = require('express-rate-limit')
const apiLimiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 1, //this number is just for testing
standardHeaders: true
legacyHeaders: false,
keyGenerator: (req, res) => {
return req.ip
},
handler: function(req, res, next) {
throw new BaseError('too many requests', 429);
next();
},
})