add dedicated config file

This commit is contained in:
teddit
2020-12-01 20:16:51 +01:00
parent c536dc53a3
commit 15a976c886
6 changed files with 82 additions and 82 deletions

View File

@@ -27,7 +27,7 @@ module.exports = function() {
if(result.status === 200) {
result.json()
.then(json => {
redis.setex(key, setexs.sidebar, JSON.stringify(json), (error) => {
redis.setex(key, config.setexs.sidebar, JSON.stringify(json), (error) => {
if(error) {
console.error('Error setting the sidebar key to redis.', error)
return res.render('index', { json: null, user_preferences: req.cookies })
@@ -50,7 +50,7 @@ module.exports = function() {
})
} else {
console.error(`Something went wrong while fetching data from reddit API. ${result.status} ${result.statusText}`)
console.error(reddit_api_error_text)
console.error(config.reddit_api_error_text)
resolve(null)
}
}).catch(error => {