This repository is backend server of this Redux_ToDo_Web repository.
- Login ➡️
- Sign Up ➡️
- Get all todo items ➡️
- Create one todo item ➡️
- Remove all completed todo items ➡️
- Updated one todo item ➡️
- Delete one todo itme ➡️
- Connect to Front-End Web Application
- Implement authentication logic using jwt
- Implement kakao oauth
- Implement github oauth
- Implement google oauth
- Deploy to Heroku using Circle CI
- More detailed exception handling
POST /login
Name | Description | Required |
---|---|---|
user | Username to login | ✔ |
password | Password to login | ✔ |
Name | Description |
---|---|
access_token | Tokens to access API that you put in the Authorization header |
error | Message in case of error |
- Success
HTTP/1.1 200 OK
Content-Type: application/json
{
"access_token": "xxxxxxxyyyyyyyzzzzzzz",
"user": "username"
}
- Fail
HTTP/1.1 401 BAD REQUEST
Content-Type: application/json
{
"error": "Invalid form. Please fill it out again."
}
POST /signup
Name | Description | Required |
---|---|---|
user | Username to login | ✔ |
password | Password to login | ✔ |
passwordConfirm | Same data as password for password verification | ✔ |
Name | Description |
---|---|
access_token | Tokens to access API that you put in the Authorization header |
error | Message in case of error |
- Success
HTTP/1.1 201 CREATED
Content-Type: application/json
{
"access_token": "xxxxxxxyyyyyyyzzzzzzz",
"user": "username"
}
- Fail
HTTP/1.1 401 BAD REQUEST
Content-Type: application/json
{
"error": "Duplicate user name. Please use a different name."
}
GET /todo
Authorization: {access_token}
Name | Description | Required |
---|---|---|
- | - | - |
Name | Description |
---|---|
data | Array consisting of todo item objects |
error | Message in case of error |
- Success
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": [
{ "id": 1, "text": "todo 1", "isCompleted": true, "user": 1 },
{ "id": 2, "text": "todo 2", "isCompleted": false, "user": 1 },
{ "id": 3, "text": "todo 3", "isCompleted": true, "user": 1 }
]
}
- Fail
HTTP/1.1 500 INTERNAL SERVER ERROR
Content-Type: application/json
{
"error": "An error has occurred. Please try again."
}
POST /todo
Authorization: {access_token}
Name | Description | Required |
---|---|---|
text | Todo item text to be created | ✔ |
Name | Description |
---|---|
data | Created todo item object |
error | Message in case of error |
- Success
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"id": 4,
"text": "todo 4",
"isCompleted": false,
"user": 1
}
}
- Fail
HTTP/1.1 500 INTERNAL SERVER ERROR
Content-Type: application/json
{
"error": "An error has occurred. Please try again."
}
DELETE /todo
Authorization: {access_token}
Name | Description | Required |
---|---|---|
- | - | - |
Name | Description |
---|---|
error | Message in case of error |
- Success
HTTP/1.1 204 NO CONTENT
Content-Type: application/json
- Fail
HTTP/1.1 500 INTERNAL SERVER ERROR
Content-Type: application/json
{
"error": "An error has occurred. Please try again."
}
PUT /todo/:id
Authorization: {access_token}
Name | Description | Required |
---|---|---|
id | Unique id of item to be updated | ✔ |
text | Text of item to be updated | - |
isCompleted | Completion of item to be updated | - |
Name | Description |
---|---|
data | Updated todo item object |
error | Message in case of error |
- Success
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"id": 4,
"text": "Updated Item",
"isCompleted": true,
"user": 1
}
}
- Fail
HTTP/1.1 500 INTERNAL SERVER ERROR
Content-Type: application/json
{
"error": "An error has occurred. Please try again."
}
DELETE /todo/:id
Authorization: {access_token}
Name | Description | Required |
---|---|---|
- | - | - |
Name | Description |
---|---|
error | Message in case of error |
- Success
HTTP/1.1 204 NO CONTENT
Content-Type: application/json
- Fail
HTTP/1.1 500 INTERNAL SERVER ERROR
Content-Type: application/json
{
"error": "An error has occurred. Please try again."
}