34 lines
948 B
TypeScript
34 lines
948 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { RabbitMQModule } from '@golevelup/nestjs-rabbitmq';
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
import { UserController } from './logger/adapters/primaries/user.controller';
|
|
import { WinstonModule } from 'nest-winston';
|
|
import * as winston from 'winston';
|
|
|
|
@Module({
|
|
imports: [
|
|
RabbitMQModule.forRootAsync(RabbitMQModule, {
|
|
imports: [ConfigModule],
|
|
useFactory: async (configService: ConfigService) => ({
|
|
exchanges: [
|
|
{
|
|
name: 'logging',
|
|
type: 'topic',
|
|
},
|
|
],
|
|
uri: configService.get<string>('RMQ_URI'),
|
|
enableControllerDiscovery: true,
|
|
}),
|
|
inject: [ConfigService],
|
|
}),
|
|
WinstonModule.forRoot({
|
|
levels: winston.config.syslog.levels,
|
|
transports: [],
|
|
}),
|
|
],
|
|
controllers: [UserController],
|
|
providers: [],
|
|
exports: [],
|
|
})
|
|
export class LoggerModule {}
|