Skip to content

How can this be used with a username/password in the env file? #202

@jnovak-SM2Dev

Description

@jnovak-SM2Dev

How can this be used with a username/password in the env file? In the @nestjs/elasticsearch module you would use registerAsync and use the configService like below. Is there a way to do the same thing with this package without having the auth info in the repo?

ElasticsearchModule.registerAsync({
      imports: [ConfigModule],
      useFactory: async (configService: ConfigService) => ({
        node: configService.get('ELASTICSEARCH_NODE'),
        auth: {
          username: configService.get('ELASTICSEARCH_USERNAME') ?? '',
          password: configService.get('ELASTICSEARCH_PASSWORD') ?? '',
        },
      }),
      inject: [ConfigService],
    }),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions