Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vote] API Mock Server 구축 (json-server) #15

Open
3 of 5 tasks
flowersayo opened this issue Jun 26, 2023 · 0 comments
Open
3 of 5 tasks

[Vote] API Mock Server 구축 (json-server) #15

flowersayo opened this issue Jun 26, 2023 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@flowersayo
Copy link

flowersayo commented Jun 26, 2023

Description

Todo

ETC

  • 폴더 구조

└─ db.json ← API mock 서버에 띄우기 위한 데이터
└─ src/
├─ components/
├─ services/ ← axios 모듈 관리 폴더
│ └─ authService.js ← 로그인, 회원가입, 로그아웃 등 유저 인증 관련
│ └─ voteService.js ← 투표 조회, 투표, 투표결과 조회 관련
├─ utils/
│ └─ http.js <= 커스텀 axios 모듈
└─ App.js

전달사항

  1. Config.js 에 export const API_SERVER_BASE_URL = 'http://localhost:8000'; 상수 추가
  2. 토큰 저장은 우선 로컬 스토리지에 access_token 라는 이름으로 해두도록 했는데 수정할 일 있으면 utils/HTTP.tsx에서 바꿔줘!!
    const token = localStorage.getItem('access_token');
  3. json-server --watch db.json --port 8000 로 localhost:8000 에서 api mock server 실행
  4. src/interface/interface.tsx 추가
@flowersayo flowersayo added documentation Improvements or additions to documentation 🧩env labels Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: No status
Development

No branches or pull requests

2 participants