feat: disable reat limits on dev mode

This commit is contained in:
Bobby 2022-04-16 21:37:39 +07:00
parent d878d161c0
commit edb7367ad3
No known key found for this signature in database
GPG Key ID: 941839794CBF5A09

View File

@ -82,8 +82,8 @@ nunjucks.configure('views', {
safe.set('view engine', 'njk')
safe.enable('view cache')
// Configure rate limits
if (Array.isArray(config.rateLimits) && config.rateLimits.length) {
// Configure rate limits (disabled during development)
if (!isDevMode && Array.isArray(config.rateLimits) && config.rateLimits.length) {
for (const _rateLimit of config.rateLimits) {
const limiter = rateLimit(_rateLimit.config)
for (const route of _rateLimit.routes) {