Skip to content

How can I pass a config service? #1

@Rossella-Mascia-Neosyn

Description

@Rossella-Mascia-Neosyn

Describe the bug
I would like to use my config service so that we can take the base url in the file. env

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
I would like to add a use factory so that we can use the config service
example:

   ClientsModule.registerAsync([
      {
        imports: [ConfigModule],
        name: 'BOILER_SERVICE',
        useFactory: async (configService: TypedConfigService) => ({
          transport: Transport.TCP,
          options: {
            host: configService.get('BOILERPLATE_MICROSERVICE.host'),
            port: configService.get('BOILERPLATE_MICROSERVICE.port'),
          },
        }),
        inject: [TypedConfigService],
        extraProviders: [TypedConfigService],
      },
    ]),

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions