2019-07-04 02:32:01 -07:00
|
|
|
const Redis = require('ioredis')
|
2019-06-20 02:42:01 -07:00
|
|
|
|
|
|
|
console.log('Connecting to redis')
|
|
|
|
|
2019-07-04 02:32:01 -07:00
|
|
|
const redis = new Redis({
|
|
|
|
port: 6379,
|
|
|
|
host: 'redis',
|
|
|
|
family: 4,
|
|
|
|
password: 'password',
|
|
|
|
db: 0
|
|
|
|
})
|
2019-06-20 02:42:01 -07:00
|
|
|
|
|
|
|
redis.on('connect', () => {
|
|
|
|
console.log('Connected to redis')
|
|
|
|
})
|
|
|
|
|
|
|
|
redis.on('error', () => {
|
|
|
|
console.log('Redis error')
|
|
|
|
})
|
|
|
|
|
2019-07-04 02:32:01 -07:00
|
|
|
module.exports = redis
|