35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { HealthServerController } from './adapters/primaries/health-server.controller';
|
|
import { PrismaHealthIndicatorUseCase } from './domain/usecases/prisma.health-indicator.usecase';
|
|
import { DatabaseModule } from '../database/database.module';
|
|
import { HealthController } from './adapters/primaries/health.controller';
|
|
import { TerminusModule } from '@nestjs/terminus';
|
|
import { RabbitMQModule } from '@golevelup/nestjs-rabbitmq';
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
import { Messager } from './adapters/secondaries/messager';
|
|
import { AdRepository } from '../ad/adapters/secondaries/ad.repository';
|
|
|
|
@Module({
|
|
imports: [
|
|
TerminusModule,
|
|
RabbitMQModule.forRootAsync(RabbitMQModule, {
|
|
imports: [ConfigModule],
|
|
useFactory: async (configService: ConfigService) => ({
|
|
exchanges: [
|
|
{
|
|
name: configService.get<string>('RMQ_EXCHANGE'),
|
|
type: 'topic',
|
|
},
|
|
],
|
|
uri: configService.get<string>('RMQ_URI'),
|
|
connectionInitOptions: { wait: false },
|
|
}),
|
|
inject: [ConfigService],
|
|
}),
|
|
DatabaseModule,
|
|
],
|
|
controllers: [HealthServerController, HealthController],
|
|
providers: [PrismaHealthIndicatorUseCase, AdRepository, Messager],
|
|
})
|
|
export class HealthModule {}
|