Question from the Nest.js test

Fix the provider declaration in Nest.js

Medium

Consider the following code:

@Module({
  providers: [
    {
      provide: 'DATABASE_SERVICE',
      useFactory: (configService: ConfigService) => {
        return new DatabaseService(configService.get('DATABASE_URL'));
      }
    }
  ]
})
export class AppModule {}

What's wrong with the provider declaration?

Author: AxelStatus: PublishedQuestion passed 30 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!