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

[wook] Step19 리뷰 부탁드립니다. #34

Merged
merged 24 commits into from
Sep 4, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a1b35a2
chore: 배경 css 변경
pocokim Aug 26, 2019
b41231b
refactor: state를 todos로 변경
pocokim Aug 26, 2019
f2ff25d
refactor: calcStatusCnt 함수 삭제
pocokim Aug 26, 2019
c8683c2
chore: 함수명 변경
pocokim Aug 27, 2019
3ab3bf8
refactor: router에 따른 폴더구조 변경
pocokim Aug 27, 2019
8b60830
feat: Home , Header 컴포넌트구현및 스타일링
pocokim Aug 27, 2019
6456f78
style: Home 컴포넌트 문장 배치수정
pocokim Aug 27, 2019
ba4cd7b
chore: 배포, 개발용 변경기능 구현
pocokim Aug 28, 2019
a11bdff
feat: PropTypes로 TodoItem 구현
pocokim Aug 30, 2019
74db1b2
feat: StateContext.Provider에 proptypes 구현
pocokim Aug 30, 2019
bc842b4
refactor: 최적화를 위한 Provider별 value분리
pocokim Sep 1, 2019
c890547
chore: TodoItem propTypes id change
pocokim Sep 1, 2019
9baad4a
refactor: TodoItem을 react.memo로 최적화함
pocokim Sep 1, 2019
9d81800
chore: 주석 삭제
pocokim Sep 1, 2019
22c267a
docs: 최적화관련 진행사항 기록
pocokim Sep 1, 2019
bbc9672
refactor: react-router 초기화면 home 컴포넌트로 변경
pocokim Sep 2, 2019
d40f88a
bugfix: 탭간 이동시 status 남아있도록 구현
pocokim Sep 2, 2019
d653db8
refactor: client 하위로 폴더구조 변경
pocokim Sep 3, 2019
e9dd4c2
feat: dev 용 서버코드 작성
pocokim Sep 3, 2019
2e81604
refactor: change port number
pocokim Sep 3, 2019
4f3152d
refactor: express.Router 이용해 분리
pocokim Sep 3, 2019
1cbd786
refactor: json파일 따로 분리후 읽어오도록 변경
pocokim Sep 3, 2019
36d66d6
chore: 불필요한 주석 제거
pocokim Sep 3, 2019
ad2da91
bugfix: webpack 개발, 배포용 변경
pocokim Sep 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions server/data/todolist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

분리 잘 했음

Copy link
Contributor

Choose a reason for hiding this comment

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

mongo db 연동도 해보면 좋겠죠.
NoSQL이 연동하기 쉽더라고요.

Copy link
Author

Choose a reason for hiding this comment

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

step 21 인증 하면서 기회가 되면 db도 구현해보겠습니다!

"statusCode": 200,
"body": [
{
"title": "로컬서버 웹팩에서 데이터 받아오기",
"id": 1233,
"status": "todo"
},
{
"title": "서버코드 작성하기",
"id": 1234,
"status": "todo"
},
{
"title": "라우터 404, 스위치 처리하기",
"id": 1230,
"status": "todo"
},
{
"title": "step20 테스트코드",
"id": 1231,
"status": "todo"
},
{
"title": "step21 인증",
"id": 1231,
"status": "todo"
}
]
}
34 changes: 8 additions & 26 deletions server/todoApp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
const express = require('express');
// 모듈로 분리하기 위해 router라는 변수를 만들고
const router = express.Router();
// fs로 읽는것의 2가지 장점. require은 동기적으로 읽어옴, 이렇게 지정한 파일은 Json밖에 못읽음 , 근데 귀찮음
// https://stackabuse.com/reading-and-writing-json-files-with-node-js/

const todolist = require("./data/todolist.json");

// const fs = require('fs');

// middleware that is specific to this router
// router로 요청이 들어왔을때 항상 실행되는 함수
Expand All @@ -18,32 +24,8 @@ router.get('/',function(req,res){
// http://localhost:3001/heart/about
router.get('/list',function(req,res){
// send와 json 차이는 뭐지?
res.send({
"statusCode": 200,
"body": [
{
"title": "로컬서버 웹팩에서 데이터 받아오기",
"id": 1233,
"status": "todo"
},
{
"title": "서버코드 작성하기",
"id": 1234,
"status": "todo"
},
{
"title": "라우터 404, 스위치 처리하기",
"id": 1230,
"status": "todo"
},
{
"title": "step20 테스트코드",
"id": 1231,
"status": "todo"
}
]
}
);
//// console.log(todolist); 로 json객체 넘어오는것 확인
res.send(todolist)

})

Expand Down