This works for local redis-server
BullModule.forRoot({
redis: {
host: "localhost",
port: 6379,
db: 0,
password: ""
}
})
But if I use the DataStore Credentials on Heroku Redis, the bull board does not load and Heroku Logs gives an H12 error.
How can I get the BullModule
to properly connect to Heroku Data for Redis?
Thanks!
2
Answers
I suggest trying
This fixed the issue for me.
You must specify the location of where redis is accessible.
localhost:6379
is the default for running redis locally, but to deploy an application that uses Redis to Heroku, you will need to add the Connecting to Heroku Data for Redis add-on. Then, you’ll need to pass the location of your Redis service viaprocess.env.REDIS_URL
to theBullModule.forRoot()
constructor.Be aware that encountering TLS issues in connecting to Redis like this are common. When I tried connecting using the format from PedroPovedaQ’s answer, I ran into one.
There’s a discusson on that here.