회원 가입 |
/api/signup |
POST |
{ "nickname": "Developer", "password": "1234", "confirm": "1234"} |
{ "message": "회원 가입에 성공하였습니다."} |
로그인 |
/api/login |
POST |
{ "nickname": "Developer", "password": "1234"} |
{ "token": "eyJhbGciO......."} |
게시글 작성 |
/api/posts |
POST |
{ "title": "안녕하세요 게시글 제목입니다.", "content": "안녕하세요 content 입니다."} |
{ "message": "게시글 작성에 성공하였습니다."} |
게시글 조회 |
/api/posts |
GET |
- |
{ "data": [ { "postId": 2, "userId": 1, "nickname": "Developer", "title": "안녕하세요 2번째 게시글 제목입니다.", "createdAt": "2022-07-25T07:45:56.000Z", "updatedAt": "2022-07-25T07:45:56.000Z", "likes": 0 }, { "postId": 1, "userId": 1, "nickname": "Developer", "title": "안녕하세요 게시글 제목입니다.", "createdAt": "2022-07-25T07:45:15.000Z", "updatedAt": "2022-07-25T07:45:15.000Z", "likes": 1 } ]} |
게시글 상세 조회 |
/api/posts/:postId |
GET |
- |
{ "data": { "postId": 2, "userId": 1, "nickname": "Developer", "title": "안녕하새요 수정된 게시글 입니다.", "content": "안녕하세요 content 입니다.", "createdAt": "2022-07-25T07:45:56.000Z", "updatedAt": "2022-07-25T07:52:09.000Z", "likes": 0} |
게시글 수정 |
/api/posts/:postId |
PUT |
{ "title": "안녕하새요 수정된 게시글 입니다.", "content": "안녕하세요 content 입니다."} |
{ "message": "게시글을 수정하였습니다."} |
게시글 삭제 |
/api/posts/:postId |
DELETE |
- |
{ "message": "게시글을 삭제하였습니다."} |
댓글 생성 |
/api/comments/:postId |
POST |
{ "comment": "안녕하세요 댓글입니다."} |
{ "message": "댓글을 작성하였습니다."} |
댓글 목록 조회 |
/api/comments/:postId |
GET |
- |
{ "data": [ { "commentId": 2, "userId": 1, "nickname": "Developer", "comment": "안녕하세요 2번째 댓글입니다.", "createdAt": "2022-07-25T07:54:24.000Z", "updatedAt": "2022-07-25T07:54:24.000Z" }, { "commentId": 1, "userId": 1, "nickname": "Developer", "comment": "안녕하세요 댓글입니다.", "createdAt": "2022-07-25T07:53:31.000Z", "updatedAt": "2022-07-25T07:53:31.000Z" } ]} |
댓글 수정 |
/api/comments/:commetId |
PUT |
{ "comment": "수정된 댓글입니다."} |
{ "message": "댓글을 수정하였습니다."} |
댓글 삭제 |
/api/comments/:commetId |
DELETE |
- |
{ "message": "댓글을 삭제하였습니다."} |
좋아요 게시글 조회 |
/api/posts/like |
GET |
- |
{ "data": [ { "postId": 4, "userId": 1, "nickname": "Developer", "title": "안녕하세요 4번째 게시글 제목입니다.", "createdAt": "2022-07-25T07:58:39.000Z", "updatedAt": "2022-07-25T07:58:39.000Z", "likes": 1 } ]} |
게시글 좋아요 |
/api/posts/:postId/like |
PUT |
- |
{ "message": "게시글의 좋아요를 등록하였습니다."},{ "message": "게시글의 좋아요를 취소하였습니다."} |