
NestJS에서 정적 경로와 동적 경로 충돌 문제 해결하기NestJS로 프로젝트를 진행하면서 REST API 경로를 설계하던 중 예상치 못한 문제가 발생했다. mentor-registration과 :mentorId 경로가 충돌하면서, GET /api/mentors/mentor-registration 요청이 동적 경로로 매핑되어 버리는 현상이었다. 분명히 컨트롤러에 mentor-registration 경로를 명시했는데, 왜 이런 일이 발생한 걸까?문제 상황: 정적 경로와 동적 경로의 충돌아래와 같은 코드가 문제였다.@Get(':mentorId')async getMentorProfile(@Param('mentorId') mentorId: string) { return this.mentorService.ge..