How to use the config service to configure other modules?
See original GitHub issueGreat library, but I’m having issues using the ConfigService
to configure other modules. Can you provide some example?
Issue Analytics
- State:
- Created 5 years ago
- Comments:11
Top Results From Across the Web
Best practice to use config service in NestJS Module
The useFactory method returns the configuration object. TypeOrmModule.forRootAsync({ imports:[ConfigModule], useFactory: async (configService ...
Read more >Configuration | NestJS - A progressive Node.js framework
A good approach for using this technique in Nest is to create a ConfigModule that exposes a ConfigService which loads the appropriate .env...
Read more >Using the NestJS Config Module to Manage Environment ...
To access the configuration values start by importing ConfigService from @nestjs/config. Inject it into the class's constructor by declaring a ...
Read more >Externalizing application Configuration | by Hantsy | The Startup
First of all, install @nestjs/config package. ... Simply, import ConfigModule in the top-level AppModule . ... It will register a ConfigService for ...
Read more >NestJS Config Module: Using environment variables - Tom Ray
Install dependencies · Add the Config Module configuration · You can now use process.env · Using custom configuration files · Validating environment ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For anyone here from google like me this is what I needed:
Documentation: https://docs.nestjs.com/techniques/mongodb#async-configuration
I was thinking about the a few days ago. Ugly solution IMHO.
I hope that the issue on nestjs will be solved. In the end, it’s all about modules depending on services (@marcus-sa solution):