refactor: migrate to PostgreSQL + Sequelize

This commit is contained in:
NGPixel
2017-07-22 23:56:46 -04:00
parent 8da98ce75a
commit d76f6182b2
40 changed files with 1044 additions and 745 deletions

29
server/modules/redis.js Normal file
View File

@@ -0,0 +1,29 @@
'use strict'
/* global wiki */
const Redis = require('ioredis')
const { isPlainObject } = require('lodash')
/**
* Redis module
*
* @return {Object} Redis client wrapper instance
*/
module.exports = {
/**
* Initialize Redis client
*
* @return {Object} Redis client instance
*/
init() {
if (isPlainObject(wiki.config.redis)) {
return new Redis(wiki.config.redis)
} else {
wiki.logger.error('Invalid Redis configuration!')
process.exit(1)
}
}
}