- method: POST
- url: localhost:3000/api/login
- bodyParams: email, password
- method: POST
- url: localhost:3000/api/logout
- header: X-Auth-Token
- method: POST
- url: localhost:3000/api/user
- bodyParams: email, password
- method: GET
- localhost:3000/api/user
- header: X-Auth-Token
- response:
{
_id: "###",
email: "###"
}
- method: POST
- url: localhost:3000/api/article
- auth: true
- header: X-Auth-Token
- bodyParams: content
- response:
{
userId: "###",
userName: "###",
content: "###",
createdAt: "###",
commentCount: "###",
likeCount: "###",
likeUsers: ["###"],
}
- method: PUT
- url: localhost:3000/api/article
- auth: true
- header: X-Auth-Token
- bodyParams: content, _id
- response:
{
userId: "###",
userName: "###",
content: "###",
createdAt: "###",
commentCount: "###",
likeCount: "###",
likeUsers: ["###"],
}
- method: DELETE
- url: localhost:3000/api/article
- auth: true
- header: X-Auth-Token
- bodyParams: _id
- method: GET
- url: localhost:3000/api/articles/:currentPage
- auth: 선택
- header: X-Auth-Token(선택)
- urlParams: currentPage
- response:
{
articleList: [
{
userId: "###",
userName: "###",
content: "###",
createdAt: "###",
commentCount: "###",
likeCount: "###",
likeUsers: ["###"],
},
...
],
totalPage: ###,
menuPopup:'###',
editMode:'###'
}
- method: GET
- url: localhost:3000/api/articles/:_id
- auth: false
- urlParams: _id
- response:
{
userId: "###",
userName: "###",
content: "###",
createdAt: "###",
commentCount: "###",
likeCount: "###",
likeUsers: ["###"],
}
- method: PUT
- url: localhost:3000/api/like
- auth: true
- header: X-Auth-Token
- bodyParams: articleId
- method: PUT
- url: localhost:3000/api/cancellike
- auth: true
- header: X-Auth-Token
- bodyParams: articleId
- method: GET
- url: localhost:3000/api/likes/:currentPage
- auth: true
- header: X-Auth-Token
- urlParam: currentPage
- response:
{
articleList: [
{
userId: "###",
userName: "###",
content: "###",
createdAt: "###",
commentCount: "###",
likeCount: "###",
likeUsers: ["###"],
},
...
],
totalPage: ###,
menuPopup:'###',
editMode:'###'
}
4. comment
4-1. comment 추가
- method: POST
- url: localhost:3000/api/comments
- auth: true
- header: X-Auth-Token
- bodyParams: articleId, content
- response:
{
userId: "###",
userName: "###",
articleId: "###",
content: "###",
createdAt: "###",
}
4-2. comment 삭제
- method: DELETE
- url: localhost:3000/api/comments
- auth: true
- header: X-Auth-Token
- bodyParams: _id, articleId
4-3 comment 목록
- method: GET
- url: localhost:3000/api/comments/:_id
- response:
[
{
userId: "###",
userName: "###",
articleId: "###",
content: "###",
createdAt: "###",
},
]