felixmosh / bull-board

🎯 Queue background jobs inspector
MIT License
2.26k stars 359 forks source link

feat: Add Async Configuration Support to NestJS Module #760

Closed AljazOblonsek closed 4 months ago

AljazOblonsek commented 4 months ago

Description

This PR extends the NestJS Dynamic Module by adding support for async configuration.

The async configuration allows us to inject/import modules or services we need to construct the module.

Example scenario of our usecase:

ConfigModule.forRoot({ envFilePath: './.env' }),
BullBoardModule.forRootAsync({
  imports: [ConfigModule], // Import Nest configuration module
  inject: [ConfigService], // Inject Nest configuration service
  useFactory: (configService: ConfigService) => ({
    route: configService.getOrThrow('QUEUE_PATH'), // Get path from Nest configuration service
    adapter: ExpressAdapter,
  })
}),

Type of change

felixmosh commented 4 months ago

@DennisSnijder, can you review & approve this change?