I have set a config module, according to https://docs.nestjs.com/techniques/configuration then how can I use it on main.ts??
nestjs version: 6.1.1
In your main.ts file after you use the NestFactory method to create the application you can use const configService = app.get<ConfigService>(ConfigService); to get the service from the context. If you want to leave out the generics that works too. After that you use it just like you would anywhere else in your app: configService.get('key');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With