Jacobdo
Jacobdo

Reputation: 2001

Connect to Heroku redis from a nestjs app

I am hosting my nestjs application on Heroku and trying to use "Heroku redis" add-on with it.

In the app.module.ts I am importing RedisModule as follows:

@Module({
 imports: [
  RedisModule.register({ host: process.env.REDIS_URL }) 
 ]
})

After configuring Heroku-redis add-on, it added REDIS_URL under config vars in Heroku, however, when I deploy and run the application, I get the following error message:

2020-06-11T09:00:48.690255+00:00 app[web.1]: [ioredis] Unhandled error event: Error: getaddrinfo ENOTFOUND redis://h:[email protected]:16719

(I've replaced the real url value with a sample one to illustrate the problem)

I can't seem to find

Upvotes: 0

Views: 711

Answers (1)

kamilregulski
kamilregulski

Reputation: 21

RedisModule.register({ url: process.env.REDIS_URL }) 

Upvotes: 2

Related Questions