Skip to content

Express 이하림 sprint5 미션 제출합니다.#6

Merged
11t518s merged 3 commits intocodeit-sprint-fullstack:mainfrom
sumforest-ha:express-이하림-sprint5
Jan 18, 2026

Hidden character warning

The head ref may contain hidden characters: "express-\uc774\ud558\ub9bc-sprint5"
Merged

Express 이하림 sprint5 미션 제출합니다.#6
11t518s merged 3 commits intocodeit-sprint-fullstack:mainfrom
sumforest-ha:express-이하림-sprint5

Conversation

@sumforest-ha
Copy link
Collaborator

@sumforest-ha sumforest-ha commented Jan 18, 2026

요구사항

기본 요구사항

공통

  • Github에 스프린트 미션 PR을 만들어 주세요.
  • React, Express를 사용해 진행합니다.

백엔드 구현 요구사항

중고마켓

  • 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 주소로 설정해서 프론트엔드와 연결했습니다.

@sumforest-ha sumforest-ha requested a review from 11t518s January 18, 2026 10:06
@sumforest-ha sumforest-ha self-assigned this Jan 18, 2026
@sumforest-ha sumforest-ha added 진행중 아직 스프린트 미션 제출일이 아닙니다. 새로 커밋된 내용에 대해 코드리뷰 해주세요! (2주 이상의 스프린트 미션 중간점검 PR 제출시 사용합니다.) 최종제출 스프린트 미션 최종 제출 PR입니다. 코드리뷰 및 평가해주세요! and removed 진행중 아직 스프린트 미션 제출일이 아닙니다. 새로 커밋된 내용에 대해 코드리뷰 해주세요! (2주 이상의 스프린트 미션 중간점검 PR 제출시 사용합니다.) labels Jan 18, 2026
@sumforest-ha sumforest-ha changed the title Express 이하림 sprint5 미션 진행 중입니다. Express 이하림 sprint5 미션 제출합니다. Jan 18, 2026
Copy link
Collaborator

@11t518s 11t518s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

전체적으로 보면서 크게 아쉬운 것 없었던 것 같습니다
너무 잘 짜주셨고 고생하셨습니다!

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: '서버 내부 오류가 발생했습니다.',
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 이렇게 메시지 묶어주는거 좋은 것 같습니다

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,
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이런 상수도 좋네요!


export class BadRequestException extends HttpException {
constructor(message = ERROR_MESSAGE.BAD_REQUEST, details = null) {
super(400, message, details);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

400 도 위에서 정의해주셨는데 요기서는 400이 바로 쓰였네용

요것도 맞춰주시면 좋을 것 같습니다!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아래에도 비슷한 케이스가 여럿 있는데 코멘트는 여기에만 넣어둘게요!

Comment on lines +9 to +11
const isAllowed = !isProduction || (origin && whiteList.includes(origin));

if (isAllowed && origin) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이미 isAllowed에 origin 을 판단하는 로직을 넣어놨는데, 두번 나와야했을까요?
고민해보시면 좋습니다!

Comment on lines +19 to +22
if (isProduction) {
throw new BadRequestException(ERROR_MESSAGE.INVALID_INPUT);
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isProduction이 아니면 invalid input 이군요....

요거는 아마 잘못 분기된 것 같아서 한번 의도가 뭐였는지 다시 파악해주시면 감사하겠습니다!

Comment on lines +8 to +10
throw new Error(
`[validate middleware] Invalid target: "${target}". Expected "body", "query", or "params".`,
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이것도 error message로 정의해놨을 수 있을 것 같아요
위에 constants 해둔 곳에 같이 정의해주시면 감사하겠습닏

@11t518s 11t518s merged commit c2fdc4d into codeit-sprint-fullstack:main Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

최종제출 스프린트 미션 최종 제출 PR입니다. 코드리뷰 및 평가해주세요!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants