Injecting configService into async configs
This commit is contained in:
parent
65d12a266d
commit
4710b1026f
1 changed files with 2 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ import { LoggerModule } from './logger/module'
|
||||||
ConfigModule.forRoot({ isGlobal: true }),
|
ConfigModule.forRoot({ isGlobal: true }),
|
||||||
TypeOrmModule.forRootAsync({
|
TypeOrmModule.forRootAsync({
|
||||||
imports: [ConfigModule],
|
imports: [ConfigModule],
|
||||||
|
inject: [ConfigService],
|
||||||
useFactory: (configService: ConfigService) => ({
|
useFactory: (configService: ConfigService) => ({
|
||||||
type: 'sqlite',
|
type: 'sqlite',
|
||||||
database: configService.get<string>(
|
database: configService.get<string>(
|
||||||
|
|
@ -32,6 +33,7 @@ import { LoggerModule } from './logger/module'
|
||||||
}),
|
}),
|
||||||
BullModule.forRootAsync({
|
BullModule.forRootAsync({
|
||||||
imports: [ConfigModule],
|
imports: [ConfigModule],
|
||||||
|
inject: [ConfigService],
|
||||||
useFactory: (configService: ConfigService) => ({
|
useFactory: (configService: ConfigService) => ({
|
||||||
redis: {
|
redis: {
|
||||||
host: configService.get<string>('REDIS_HOST', 'localhost'),
|
host: configService.get<string>('REDIS_HOST', 'localhost'),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue