Hybrid application

Hybrid application

ํ•˜์ด๋ธŒ๋ฆฌ๋“œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์€ HTTP ์š”์ฒญ์„ ์ฒญ์ทจํ•˜๊ณ  ์—ฐ๊ฒฐ๋œ ๋งˆ์ดํฌ๋กœ ์„œ๋น„์Šค๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ž…๋‹ˆ๋‹ค. INestApplication์€ connectMicroservice()๋ฉ”์†Œ๋“œ๋ฅผ ํ†ตํ•ด ๋ฌดํ•œํ•œ ์ˆ˜์˜ INestMicroservice ์ธ์Šคํ„ด์Šค์™€ ๊ฒฐํ•ฉ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

const app = await NestFactory.create(ApplicationModule);
const microservice = app.connectMicroservice({
  transport: Transport.TCP,
});

await app.startAllMicroservicesAsync();
await app.listen(3001);

Last updated

Was this helpful?