nestjs-config

Nest.js can't resolve dependencies

此生再无相见时 提交于 2021-02-11 13:34:39
问题 I am trying to use ConfigService in my users.module.ts but I am getting an Error: Nest can't resolve dependencies of the UsersService (UserRepository, HttpService, ?). Please make sure that the argument ConfigService at index [2] is available in the UsersModule context. Potential solutions: If ConfigService is a provider, is it part of the current UsersModule? If ConfigService is exported from a separate @Module, is that module imported within UsersModule? I have imported the ConfigModule in

Nest.js can't resolve dependencies

人走茶凉 提交于 2021-02-11 13:34:25
问题 I am trying to use ConfigService in my users.module.ts but I am getting an Error: Nest can't resolve dependencies of the UsersService (UserRepository, HttpService, ?). Please make sure that the argument ConfigService at index [2] is available in the UsersModule context. Potential solutions: If ConfigService is a provider, is it part of the current UsersModule? If ConfigService is exported from a separate @Module, is that module imported within UsersModule? I have imported the ConfigModule in

Nestjs Config access to config in bootstrap level

China☆狼群 提交于 2020-12-14 02:32:23
问题 According to this documentation you import your config in AppModule. I'm trying to access to config in bootstrap level in my main.ts file. Something like this: const app = await NestFactory.create(AppModule); if (config.get('swagger.enabled')) { initSwagger(app); } await app.listen(8080); The problem that I don't have access to config in this point, only other moudle will get access to config like this: @Injectable() export class SomeService { constructor(private readonly httpService:

Nestjs Config access to config in bootstrap level

喜夏-厌秋 提交于 2020-12-14 02:27:09
问题 According to this documentation you import your config in AppModule. I'm trying to access to config in bootstrap level in my main.ts file. Something like this: const app = await NestFactory.create(AppModule); if (config.get('swagger.enabled')) { initSwagger(app); } await app.listen(8080); The problem that I don't have access to config in this point, only other moudle will get access to config like this: @Injectable() export class SomeService { constructor(private readonly httpService: