I have two microservice (using nest.js) deployed on heroku. When I try to connect I get this error: Error: getaddrinfo ENOTFOUND https://URL.herokuapp.com
This is the my way for connect to microsrevice.
{
imports: [ConfigModule],
inject: [ConfigService],
name: 'CURRENCY_SERVICE',
useFactory: (configService: ConfigService) => {
return {
transport: Transport.TCP,
options: {
host: configService.services.currency.host,
port: configService.services.currency.port,
},
}
},
}
I couldn't find the port number heroku assign. So I just log the port number after app is up and copied to .env file.
This is my .env file
CURRENCY_SERVICE_HOST=https://URL.herokuapp.com
CURRENCY_SERVICE_PORT=53294 # I copied this port number from view logs section on heroku
Also I tried access without port but still can't connect. I can connect on localhost by he way. I just need to find correct connection credentials please help me