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

[2주차] 기본/도전 과제 제출 #2

Merged
merged 4 commits into from
Oct 15, 2022
Merged

[2주차] 기본/도전 과제 제출 #2

merged 4 commits into from
Oct 15, 2022

Conversation

onpyeong
Copy link
Contributor

SERVER PR


🐕 과제 구현 명세

  • [기본 과제] : callback 함수, promise, async-await 실습 코드를 정리했습니다
  • [도전 과제] : blog, members 등 라우팅을 구현했습니다

🐥 이런 점이 새로웠어요 / 어려웠어요

  • promise-chaining에서 then에서 throw error를 하면 바로 catch로 이동하는게 새로웠습니다!
  • promise랑 비교해서 async-await을 쓰니까 확실히 더 명확하게 이해됐습니다.
  • 도전 과제를 하다가 새로운 오류가 나서 yarn도 재설치하고 이것저것 해봤는데 알고보니 module export를 깜빡해서 생긴 오류였는데, 여기서 시간이 좀 걸렸어요..

@onpyeong onpyeong self-assigned this Oct 13, 2022
const router: Router = express.Router();

router.get("/", (req: Request, res: Response) => {
const blog: Object = {
Copy link
Member

@m1njae m1njae Oct 13, 2022

Choose a reason for hiding this comment

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

작성해주신 것처럼 Object는 모든 객체가 할당이 될 수 있습니다:) 어떻게 보면 any와 같을 수도 있겠네요! 그렇지만 Object를 타입으로 정의하는 경우 타입 검사에 엄격한 TypeScript를 사용하는 의도가 모호해질 수도 있다는 생각이 들었어요😢
객체의 타입을 명확하게 정의하기 위해서 1차세미나에서 배웠던 interface를 활용해보는 건 어떨까용?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

interface로 쓸 생각을 못했네요! 추후에 수정하겠습니다!

Copy link
Member

@m1njae m1njae left a comment

Choose a reason for hiding this comment

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

과제하시느라 고생 많이 하셨습니다 !! 질문 해주신 내용 덕분에 리뷰남겨조 성장중..!💪
화이팅해보자구요🔥

});
});

module.exports = router;
Copy link
Member

@m1njae m1njae Oct 13, 2022

Choose a reason for hiding this comment

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

파일 마지막에 빨간색 금지 표지판같이 생긴거 보이시나욥?
파일의 끝엔 EOF 라고 개행문자를 추가하는게 좋습니다!
참고하면 좋을거 같아요 !

vscode에서 개행 추가하는 방법은 다음과 같습니다!
image

Copy link

@kkyu0718 kkyu0718 left a comment

Choose a reason for hiding this comment

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

민재님 노션글 처럼 router를 따로 분리하는 것도 좋은 연습이 될거 같습니당!!
수현님 덕분에 module export랑 파일 명명법 등등 많은 공부를 했었습니다.

이번 과제도 하느랴 고생 많으셨습니다 👏👏

title: "글 제목",
writer: "곰돌이",
content: "글 내용~",
isLike: true,

Choose a reason for hiding this comment

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

blog 타입 선언을 Object라고 해도 되긴 하지만 나중에 더 자세히 선언하실거면 interface를 만들어서 타입 지정을 해도 좋을거 같습니당
곰돌이~ 귀여워용 ㅎㅎㅎ

Copy link
Contributor Author

Choose a reason for hiding this comment

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

오 좋습니다!

@onpyeong onpyeong merged commit 12765fc into main Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants