diff --git a/src/main.ts b/src/main.ts index 13cad38..c1773d9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,16 @@ import { NestFactory } from '@nestjs/core'; +import { Transport, MicroserviceOptions } from '@nestjs/microservices'; import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); - await app.listen(3000); + app.connectMicroservice({ + transport: Transport.NATS, + options: { + servers: [process.env.NATS_SERVER], + queue: 'authz', + }, + }); + await app.listen(9990); } bootstrap();