description: "NestJS 아키텍처 및 패턴" paths:
src/
├── app.module.ts
├── (도메인)/
│ ├── (도메인).module.ts
│ ├── (도메인).controller.ts
│ ├── (도메인).service.ts
│ ├── dto/
│ │ ├── create-(도메인).dto.ts
│ │ └── update-(도메인).dto.ts
│ └── entities/
│ └── (도메인).entity.ts
└── common/
├── guards/
├── filters/
└── interceptors/
class-validator를 사용해 입력 유효성 검사
export class CreateUserDto {
@IsEmail()
email: string;
@IsString()
@MinLength(8)
password: string;
}
NestJS 내장 예외를 사용한다.
throw new NotFoundException(`User ${id} not found`);
throw new BadRequestException('Invalid input');
throw new UnauthorizedException();
아직 피드백이 없어요. 첫 번째로 의견을 남겨보세요!