I have created a Nodejs server that uses Redis. It runs fine when I am running it in my machine. But I get the error above when I try to push the code to heroku. I already installed Redis togo and I can see the REDISTOGO_URL
in my config variable.
Following some Stackoverflow posts I did:
let RedisStore = require('connect-redis')(session)
let redisClient = redis.createClient()
if(process.env.REDISCLOUD_URL){
let redisURL = url.parse(process.env.REDISCLOUD_URL);
redisClient = redis.createClient(redisURL)
}
My app runs fine in development but when I try to start my app in heroku I get the following error when I do heroku logs --tail
:
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379