How to import clientsmodule from AppModule to other module nestjs

Viewed 212

I have a registered microservice in app module of Bus.

 @Module({
  imports: [
    ClientsModule.register([
      {
        name: 'awesomemodule',
        transport: Transport.TCP,
        options: {
          host: '127.0.0.1',
          port: 4001,
        },
      },
    ]),
    HealthCheckModule,
  ],
  controllers: [AppController, HealthCheckController],
  providers: [AppService],
  exports: [ClientsModule],
})
export class AppModule {}

And i want to import this module to other module.

@Module({
  providers: [HealthCheckService],
  controllers: [HealthCheckController],
  imports: [],
})
export class HealthCheckModule {}

How i can do it?

0 Answers
Related