If I try to use environment value like port: parseInt(process.env.PORT, 10) || 3000, instead of hard coded values, current implementation doesn't get correct value from .env.
Solution
I moved config object into function, now the config object will be generated on ConfigModule.forRoot({ isGlobal: true, load: [config] }) and we can get values from .env if we want.
Problem
If I try to use environment value like
port: parseInt(process.env.PORT, 10) || 3000,
instead of hard coded values, current implementation doesn't get correct value from.env
.Solution
I moved
config
object into function, now the config object will be generated onConfigModule.forRoot({ isGlobal: true, load: [config] })
and we can get values from.env
if we want.source: https://docs.nestjs.com/techniques/configuration#custom-configuration-files