image.png

각 파일들의 역할

main.ts

The entry file of the application which uses the core function NestFactory to create a Nest application instance.

controller.ts

A basic controller with a single route.

module.ts

The root module of the application.

service.ts

A basic service with a single method.

Nest.js의 아키텍처

controlller.ts ⇒ 라우팅을 담당하고, Service의 함수로 연결.

service.ts ⇒ 비즈니스 로직을 담당하고, 컨트롤러에서 사용되는 메서드를 정의.

module