1. Nest.js 폴더 구조 형성

nest new ./

해당 코드를 치면 알아서 필요한 코드 파일을 작성해준다.

Documentation | NestJS - A progressive Node.js framework

2. 기본 파일 생성 후 코드 파일 작성 시

$ nest generate <schematic> <name> [options]
$ nest g <schematic> <name> [options]

<name>은 만들어야하는 기능 (Ex : Board, User 등 Domain)을 넣어주면 된다.

schematic의 경우, 다양한 schema를 가진다.

Untitled

Controller를 만들려면 이것을 넣어주면 되고, Service를 만들려먼 Service를 Schematic에 넣어주면 된다.

만약 그냥 CRUD 전체를 만들어버리고 싶다면

$ nest g resource