refactor: project cleanup + onboarding page

This commit is contained in:
NGPixel
2018-02-04 00:53:13 -05:00
parent 1d9f057f38
commit 3471a7a6f9
80 changed files with 177 additions and 2782 deletions

23
server/core/redis.js Normal file
View File

@@ -0,0 +1,23 @@
const Redis = require('ioredis')
const { isPlainObject } = require('lodash')
/* global wiki */
module.exports = {
init() {
if (isPlainObject(wiki.config.redis)) {
let red = new Redis(wiki.config.redis)
red.on('ready', () => {
wiki.logger.info('Redis connection: [ OK ]')
})
red.on('error', () => {
wiki.logger.error('Failed to connect to Redis instance!')
process.exit(1)
})
return red
} else {
wiki.logger.error('Invalid Redis configuration!')
process.exit(1)
}
}
}