check if config.rate_limiting exists

This commit is contained in:
teddit 2021-03-28 07:16:00 +02:00
parent a5779cac53
commit 26dc6be763
1 changed files with 4 additions and 0 deletions

View File

@ -13,6 +13,10 @@ module.exports = (app, redis, fetch, RedditAPI) => {
let processSubredditsExplore = require('./inc/processSubredditsExplore.js')();
app.all('*', (req, res, next) => {
if(!config.rate_limiting) {
return next()
}
if(config.rate_limiting.enabled) {
/**
* This route enforces request limits based on an IP address if