Skip to content

DB 연결 후 서버 시작#120

Open
gunhoflash wants to merge 2 commits intomasterfrom
gunhoflash-patch-1
Open

DB 연결 후 서버 시작#120
gunhoflash wants to merge 2 commits intomasterfrom
gunhoflash-patch-1

Conversation

@gunhoflash
Copy link
Copy Markdown
Member

DB 연결을 마친 후 서버를 시작할 수 있게 하고자 했습니다. 리뷰 부탁드립니다.

Comment thread server/server/db.ts
.catch((e: Error) => {
throw (e);
});
await mongoose.connect(secret.mongoURI, {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

이미 then 과 catch로 callback 구조를 이용하고 있는데 await이 같이 존재할 필요가 있을까요?

개인적으로는 깔끔한 코드를 위해 await, try, catch 문만 사용하고 then, catch는 없애버리는게 좋아보입니다.

@gunhoflash gunhoflash requested a review from iwanhae October 14, 2020 13:37
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.

2 participants