-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like 안했쥬? 킹받쥬? 또빡치쥬? approve 안줄꺼죠??
// 나 이런식으로 request param을 써주고 싶은데 | ||
// 최종적인 url이 api/blog/:postID/like 이랬으면 좋겠는데. 안되더라? | ||
// router.use("/:postID/like", require("./like")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
된텐데? 해보자 homework임ㅋㅋ
// 타입가드 | ||
if (ob && yb) { | ||
const dinnerMember: String[] = [ob.name, yb.name]; | ||
console.log( | ||
`오늘의 저녁 식사 멤버는 ${dinnerMember[0]}, ${dinnerMember[1]}` | ||
); | ||
} else { | ||
console.log("undefined가 나왔겠지요"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굳굳 이왕이면 옵셔널체이닝도ㅋㅋ
There was a problem hiding this 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 이랬으면 좋겠는데. 안되더라? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 혹시 정확히 어떤게 안된다는거죠??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이렇게 뜬다는... @junjuning @jokj624 네네..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const { postId } = req.params;
써줘보세요
There was a problem hiding this comment.
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;
There was a problem hiding this comment.
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"));
// 최종적인 url이 api/blog/:postID/like 이랬으면 좋겠는데. 안되더라? | ||
// router.use("/:postID/like", require("./like")); | ||
|
||
router.use("/like", require("./like")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junjuning like 여기 있긴 있음 뒤질?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ㅋㅋ쏘리~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생했네 윤후릐 ㅋㅋㅋㅋㅋ 특 별 히 approve 드립니다 ㅋㅎㅋㅎㅋㅎㅋㅎ
There was a problem hiding this 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")); |
There was a problem hiding this 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 이랬으면 좋겠는데. 안되더라? |
There was a problem hiding this comment.
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>"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ios를 떠나겠다는 뜻인가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oownahcohc iOS 포레버
📌 관련 이슈
closed #4
📌 PR Point