Skip to content

✨ mock api 환경 구성 #84

Description

@rkskekzzz

추가할 기능

백엔드 구성이 완료되지 않았기 때문에, 조금 더 빠른 프론트엔드 개발을 진행할 수 있도록 mock api 환경을 구성합니다.

현재 구상중인 방법은 next.js의 api route 를 활용한 방법을 사용하려고 합니다. base url만 바꿨을 때, 동일하게 동작할 수 있도록 환경을 구성합니다

// 실제 데이터 요청
const res = await fetch('https://실제백엔드주소/{endpoint}')
// mock 데이터 요청
const res = await fetch('/api/mock/{endpoint}')

.env 파일에서 baseurl을 관리할 수 있도록 구성합니다

# .env.development
BASE_URL=http://localhost:port/api/mock
# .env.production
BASE_URL=https://실제백엔드주소

할 일 목록

  • DTO 타입 정의
  • api route 구성

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions