diff --git a/README.md b/README.md index 7cf6568a4933926b35fa1da6310017cbcc536e70..f294882474d59dbea1b525b4e4895564a0bcc928 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,34 @@ #### 프론트: cd frontend; npm run start #### 백앤드: cd backend; npm run start 프론트 백 모두 문서 저장되면 다시 로딩 되니까 두개 한번에 켜놓고 수정하시면 되시겠습니다. + +## Auth Specification +|Method|Path|Message Format(JSON)|설명| +|---|---|---|---| +|POST|/auth/login|{ + "email": string, + "name": string, + "sub": string, + "picture": string, +}|로그인 요청| +|GET|/auth/logout||로그아웃 요청| +|GET|/auth/session||세션 연결 확인 요청| + +## Article Specification +|Method|Path|Message Format(JSON)|설명| +|---|---|---|---| +|POST|/article|{ + "title": string, + "content": string, + "img": string[], + "keyword": string, + "latitiude": number, + "longitude": number +}|게시글 작성 요청| +|GET|/article||전체 게시글 요청| +|GET|/article/[id]||특정 게시글 요청| +|POST|/article/[id]/comment|{ + "content": string +}|댓글 작성 요청| +|DELETE|/article/[articleId]/comment/[commentId]||특정 댓글 삭제 요청| +|PUT|/article/[id]/like||게시글 좋아요 요청| \ No newline at end of file diff --git a/backend/src/article/articleController.js b/backend/src/article/articleController.js index a445fc9d211b8464ce1eeba8408c68849faebe9d..7a9dd006a70e4c564bd7b934c878f4b633f8e65d 100644 --- a/backend/src/article/articleController.js +++ b/backend/src/article/articleController.js @@ -107,7 +107,7 @@ router.delete("/:articleid/comment/:commentid", async (req, res) => { res.send(JSON.stringify(articles)); }); -router.put("/:id/comment/like", async (req, res) => { +router.put("/:id/like", async (req, res) => { if (!req.session.sessionid) { console.log("No session"); } diff --git a/frontend/src/pages/PostRead.js b/frontend/src/pages/PostRead.js index 3bbad99491fc500ab9b926fb8acbb790d9ce3cd3..c03632b88ced4b35b4562970b4d3a72d645d31dd 100644 --- a/frontend/src/pages/PostRead.js +++ b/frontend/src/pages/PostRead.js @@ -44,7 +44,7 @@ function PostRead() { }, []); function SetLike(){ - axios.put(`http://localhost:8080/article/${params.id}/comment/like`) + axios.put(`http://localhost:8080/article/${params.id}/like`) .then(res => { alert("The comment is successfully uploaded"); return requestLoadArticleById(params.id)