Skip to content

Commit

Permalink
feat: add nats adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
notusertelken committed Sep 20, 2022
1 parent c9f8082 commit 65732b6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -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<MicroserviceOptions>({
transport: Transport.NATS,
options: {
servers: [process.env.NATS_SERVER],
queue: 'authz',
},
});
await app.listen(9990);
}
bootstrap();

0 comments on commit 65732b6

Please sign in to comment.