-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
this example not works:
// with a function for dynamic-ness
limiter({
lookup: function(req, res, opts, next) {
if (validApiKey(req.query.api_key)) {
opts.lookup = 'query.api_key'
opts.total = 100
} else {
opts.lookup = 'connection.remoteAddress'
opts.total = 10
}
return next()
}
})
app.use('/api', limiter({
lookup: function(req, res, opts, next) {
opts.lookup = 'connection.remoteAddress';
opts.total = 1000;
return next();
},
}));
Got TypeError: opts.lookup is not a function
Metadata
Metadata
Assignees
Labels
No labels