Express 이하림 sprint5 미션 제출합니다.#6
Merged
11t518s merged 3 commits intocodeit-sprint-fullstack:mainfrom Jan 18, 2026
Hidden character warning
The head ref may contain hidden characters: "express-\uc774\ud558\ub9bc-sprint5"
Merged
Conversation
11t518s
approved these changes
Jan 18, 2026
Collaborator
11t518s
left a comment
There was a problem hiding this comment.
전체적으로 보면서 크게 아쉬운 것 없었던 것 같습니다
너무 잘 짜주셨고 고생하셨습니다!
Comment on lines
+2
to
+22
| export const ERROR_MESSAGE = { | ||
| // item 관련 | ||
| ITEM_NOT_FOUND: 'Item not found', | ||
| NAME_REQUIRED: 'name is required', | ||
| SEARCH_QUERY_REQUIRED: 'Search query is required', | ||
| FAILED_TO_FETCH_ITEMS: 'Failed to fetch items', | ||
| FAILED_TO_FETCH_ITEM: 'Failed to fetch item', | ||
| FAILED_TO_CREATE_ITEM: 'Failed to create item', | ||
| FAILED_TO_UPDATE_ITEM: 'Failed to update item', | ||
| FAILED_TO_DELETE_ITEM: 'Failed to delete item', | ||
| FAILED_TO_SEARCH_ITEM: 'Failed to search item', | ||
|
|
||
| // Validation | ||
| INVALID_INPUT: 'Invalid input', | ||
| VALIDATION_FAILED: 'Validation failed', | ||
|
|
||
| // 일반 에러 (Exception 기본값으로 사용) | ||
| RESOURCE_NOT_FOUND: '리소스를 찾을 수 없습니다.', | ||
| BAD_REQUEST: '잘못된 요청입니다.', | ||
| INTERNAL_SERVER_ERROR: '서버 내부 오류가 발생했습니다.', | ||
| }; |
Collaborator
There was a problem hiding this comment.
오 이렇게 메시지 묶어주는거 좋은 것 같습니다
Comment on lines
+2
to
+10
| export const HTTP_STATUS = { | ||
| OK: 200, | ||
| CREATED: 201, | ||
| NO_CONTENT: 204, | ||
| BAD_REQUEST: 400, | ||
| NOT_FOUND: 404, | ||
| CONFLICT: 409, | ||
| INTERNAL_SERVER_ERROR: 500, | ||
| }; |
|
|
||
| export class BadRequestException extends HttpException { | ||
| constructor(message = ERROR_MESSAGE.BAD_REQUEST, details = null) { | ||
| super(400, message, details); |
Collaborator
There was a problem hiding this comment.
400 도 위에서 정의해주셨는데 요기서는 400이 바로 쓰였네용
요것도 맞춰주시면 좋을 것 같습니다!
Collaborator
There was a problem hiding this comment.
아래에도 비슷한 케이스가 여럿 있는데 코멘트는 여기에만 넣어둘게요!
Comment on lines
+9
to
+11
| const isAllowed = !isProduction || (origin && whiteList.includes(origin)); | ||
|
|
||
| if (isAllowed && origin) { |
Collaborator
There was a problem hiding this comment.
이미 isAllowed에 origin 을 판단하는 로직을 넣어놨는데, 두번 나와야했을까요?
고민해보시면 좋습니다!
Comment on lines
+19
to
+22
| if (isProduction) { | ||
| throw new BadRequestException(ERROR_MESSAGE.INVALID_INPUT); | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
isProduction이 아니면 invalid input 이군요....
요거는 아마 잘못 분기된 것 같아서 한번 의도가 뭐였는지 다시 파악해주시면 감사하겠습니다!
Comment on lines
+8
to
+10
| throw new Error( | ||
| `[validate middleware] Invalid target: "${target}". Expected "body", "query", or "params".`, | ||
| ); |
Collaborator
There was a problem hiding this comment.
이것도 error message로 정의해놨을 수 있을 것 같아요
위에 constants 해둔 곳에 같이 정의해주시면 감사하겠습닏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요구사항
기본 요구사항
공통
백엔드 구현 요구사항
중고마켓
Product 스키마를 작성해 주세요.
id, name, description, price, tags, createdAt, updatedAt필드를 가집니다.
필요한 필드가 있다면 자유롭게 추가해 주세요.
상품 등록 API를 만들어 주세요.
name, description, price, tags를 입력하여 상품을 등록합니다.
상품 상세 조회 API를 만들어 주세요.
id, name, description, price, tags, createdAt를 조회합니다.
상품 수정 API를 만들어 주세요.
PATCH 메서드를 사용해 주세요.
상품 삭제 API를 만들어 주세요.
상품 목록 조회 API를 만들어 주세요.
id, name, price, createdAt를 조회합니다.
offset 방식의 페이지네이션 기능을 포함해 주세요.
최신순(recent)으로 정렬할 수 있습니다.
name, description에 포함된 단어로 검색할 수 있습니다.
각 API에 적절한 에러 처리를 해 주세요.
각 API 응답에 적절한 상태 코드를 리턴하도록 해 주세요.
. env 파일에 환경 변수를 설정해 주세요.
CORS를 설정해 주세요.
render.com로 배포해 주세요.
MongoDB를 활용해 주세요.
멘토님에게
시간이 부족해서 배포를 못했습니다. CORS는 localhost 주소로 설정해서 프론트엔드와 연결했습니다.