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

[Add] 2주차 세미나 과제 완료 #5

Merged
merged 6 commits into from
Apr 16, 2022
Merged

[Add] 2주차 세미나 과제 완료 #5

merged 6 commits into from
Apr 16, 2022

Conversation

heerucan
Copy link
Member

@heerucan heerucan commented Apr 14, 2022

📌 관련 이슈

closed #4

📌 PR Point

  • 2주차 과제 완료 -> assignmen2 폴더임
  • 아 제법 어려움;;;;
  • 나도 post 하고 싶다;;; 나도 request body 보고 싶네~ 어케함?
  • 캐치미 서버 라우팅 좀 참고해봄ㅋ

Copy link
Member

@junjuning junjuning left a comment

Choose a reason for hiding this comment

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

like 안했쥬? 킹받쥬? 또빡치쥬? approve 안줄꺼죠??

Comment on lines 5 to 7
// 나 이런식으로 request param을 써주고 싶은데
// 최종적인 url이 api/blog/:postID/like 이랬으면 좋겠는데. 안되더라?
// router.use("/:postID/like", require("./like"));
Copy link
Member

Choose a reason for hiding this comment

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

된텐데? 해보자 homework임ㅋㅋ

Comment on lines +41 to +49
// 타입가드
if (ob && yb) {
const dinnerMember: String[] = [ob.name, yb.name];
console.log(
`오늘의 저녁 식사 멤버는 ${dinnerMember[0]}, ${dinnerMember[1]}`
);
} else {
console.log("undefined가 나왔겠지요");
}
Copy link
Member

Choose a reason for hiding this comment

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

굳굳 이왕이면 옵셔널체이닝도ㅋㅋ

Copy link
Member

@jokj624 jokj624 left a comment

Choose a reason for hiding this comment

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

참 잘했어요.

const router: Router = express.Router();

// 나 이런식으로 request param을 써주고 싶은데
// 최종적인 url이 api/blog/:postID/like 이랬으면 좋겠는데. 안되더라?
Copy link
Member

Choose a reason for hiding this comment

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

이거 혹시 정확히 어떤게 안된다는거죠??

Copy link
Member Author

Choose a reason for hiding this comment

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

스크린샷 2022-04-15 오전 2 28 25

이렇게 뜬다는... @junjuning @jokj624 네네..

Copy link
Member

Choose a reason for hiding this comment

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

const { postId } = req.params; 써줘보세요

Copy link
Member

Choose a reason for hiding this comment

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

오잉 코드를 살펴봐야겠군요 저는 루희님의 코드를 그대로 가져가서 만들었는데 되는데 ?!

import express, { Router } from "express";

const router: Router = express.Router();

// 나 이런식으로 request param을 써주고 싶은데
// 최종적인 url이 api/blog/:postID/like 이랬으면 좋겠는데. 안되더라?
// router.use("/:postID/like", require("./like"));

router.use("/:postId/like", require("./like"));

module.exports = router;
import express, { Request, Response, Router } from "express";

const router: Router = express.Router();

// 내가 원하는 방식으로 하려면 이렇게 해줘야 한대..
// const getRouter = (req: Request, res: Response) => {
//   return res.status(200).json({
//     status: 200,
//     message: "좋아요 성공, post 나도 req body 보고 싶다.",
//   });
// };

router.get("/", (req: Request, res: Response) => {
    return res.status(200).json({
        status: 200,
        message: "좋아요 성공, post 나도 req body 보고 싶다.",
    });
});

module.exports = router;

Copy link
Member Author

Choose a reason for hiding this comment

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

제가 use를 get이라고 쓰는 실수가 있었네요
get은 왜 안되는 건가하고 보니 get은 get에 대한 요청에만 응답을 한다고 합니다..
무지랭이 가튼 녀석...

router.get("/:postId/like", require("./like"));

seminar1/random.ts Show resolved Hide resolved
// 최종적인 url이 api/blog/:postID/like 이랬으면 좋겠는데. 안되더라?
// router.use("/:postID/like", require("./like"));

router.use("/like", require("./like"));
Copy link
Member Author

Choose a reason for hiding this comment

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

@junjuning like 여기 있긴 있음 뒤질?

Copy link
Member

Choose a reason for hiding this comment

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

ㅋㅋ쏘리~

Copy link
Member

@orijoon98 orijoon98 left a comment

Choose a reason for hiding this comment

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

고생했네 윤후릐 ㅋㅋㅋㅋㅋ 특 별 히 approve 드립니다 ㅋㅎㅋㅎㅋㅎㅋㅎ

@heerucan heerucan requested a review from l2hyunwoo April 14, 2022 17:36
Copy link
Member

@junjuning junjuning left a comment

Choose a reason for hiding this comment

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

특!별!히 approve 해드립니다. 제가 like를 못봤네요 죄송..

// 최종적인 url이 api/blog/:postID/like 이랬으면 좋겠는데. 안되더라?
// router.use("/:postID/like", require("./like"));

router.use("/like", require("./like"));
Copy link
Member

Choose a reason for hiding this comment

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

ㅋㅋ쏘리~

const router: Router = express.Router();

// 나 이런식으로 request param을 써주고 싶은데
// 최종적인 url이 api/blog/:postID/like 이랬으면 좋겠는데. 안되더라?
Copy link
Member

Choose a reason for hiding this comment

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

const { postId } = req.params; 써줘보세요

// 여기에 이제 서버에서 보내줄 코드
// 한글 인코딩?? 설정이 안되어 있나봄
res.write("<h1> hello world </h1>");
res.end("<p> bye ios ? </p>");

Choose a reason for hiding this comment

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

ios를 떠나겠다는 뜻인가요?

Copy link
Member Author

Choose a reason for hiding this comment

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

@oownahcohc iOS 포레버

@heerucan heerucan merged commit f143a99 into main Apr 16, 2022
@heerucan heerucan deleted the seminar/2 branch April 16, 2022 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 2차 세미나 과제
5 participants