monorepo-microservice-rbac/apps/services/aorta/report/src/main.ts
2023-08-27 14:37:59 +08:00

20 lines
550 B
TypeScript

import { MicroserviceOptions, Transport } from '@nestjs/microservices';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.createMicroservice<MicroserviceOptions>(
AppModule,
{
transport: Transport.NATS,
options: {
servers: ['nats://localhost:4222'], // 可以指定链接到多个nats的消息队列
maxReconnectAttempts: 5,
reconnectTimeWait: 1000,
},
},
);
await app.listen();
}
bootstrap();