Skip to content

Conversation

@mi-373
Copy link

@mi-373 mi-373 commented Jul 8, 2024

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 on ConfigModule.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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant