Route | Method | Request(s) | Response(s) | Description |
---|---|---|---|---|
/ |
GET | none |
200 OK |
Showing home in a JSON format |
Route | Method | Request(s) | Response(s) | Description |
---|---|---|---|---|
/register |
POST | Body name: String email: String password: String |
Success201 CreatedFail 500 Internal Server Error |
Create a user |
/login |
POST | Body email: String password: String |
Success200 OKFail 400 Bad Request |
Sign a user in |
/auth/google |
POST | Headers token: String |
Success200 OKFail 400 Bad Request |
Sign a user in using Google account |
/users |
GET | none |
Success200 OKFail 401 Authorization Error500 Internal Server Error |
Get all users |
/users/:id |
GET | Headers token: String |
Success200 OKFail 401 Authorization Error500 Internal Server Error |
Get one user |
/users/:id |
PUT | Headers token: String Body name: String email: String password: String |
Success200 OKFail 401 Authorization Error500 Internal Server Error |
Update one user |
/users/:id |
DELETE | Headers token: String |
Success200 OKFail 401 Authorization Error500 Internal Server Error |
Delete a user |
Route | Method | Request(s) | Response(s) | Description |
---|---|---|---|---|
/articles |
POST | Headers token: String Body name: String description: String dueDate: Date |
Success201 CreatedFail 401 Authorization Error500 Internal Server Error |
Create an article |
/articles |
GET | Headers token: String |
Success200 OKFail 401 Authorization Error500 Internal Server Error |
Get all articles |
/articles/tag |
GET | Headers token: String Query tag: String |
Success200 OKFail 401 Authorization Error500 Internal Server Error |
Get all articles with given tag |
/articles/myArticle |
GET | Headers token: String |
Success200 OKFail 401 Authorization Error500 Internal Server Error |
Get all user's articles |
/articles/:articleId |
GET | Headers token: String |
Success200 OKFail 401 Authorization Error500 Internal Server Error |
Get one article |
/articles/:articleId |
PUT | Headers token: String Body name: String description: String dueDate: Date status: Boolean |
Success200 OKFail 401 Authorization Error500 Internal Server Error |
Update one article |
/articles/:articleId |
DELETE | Headers token: String |
Success200 OKFail 401 Authorization Error500 Internal Server Error |
Delete an article |
Route | Method | Request(s) | Response(s) | Description |
---|---|---|---|---|
/* |
any | any | Fail404 Not Found |
Catch any unmatched routes and redirect them here |