JSPS 스터디 4주차 대면 모임 과제인 React 구현 스터디를 위한 TODO API 레포입니다.
npm install
npm start
- 위 순서대로 실행하면 localhost:8000 포트에 서버가 실행됩니다.
- 서버를 실행하면 db.sqlite 파일이 생성되며 해당 파일을 삭제 시 기존의 데이터는 초기화 됩니다.
- End point :
http://localhost:8000
- URL:
/todo
- Method:
POST
- Headers:
- Content-Type:
application/json
- Content-Type:
- Body:
- todo: string
-
status: 201 Created
-
body
{ "todo": "my todo", "id": 5, "isCompleted": false }
- URL:
/todo/all
- Method:
GET
- status: 200 OK
- body
[
[
{
"id": 1,
"todo": "my todo1",
"isCompleted": false
},
{
"id": 2,
"todo": "my todo2",
"isCompleted": false
},
{
"id": 3,
"todo": "my todo3",
"isCompleted": false
}
],
3
]
- URL:
/todo/:id
- Method:
PUT
- Headers:
- Content-Type:
application/json
- Content-Type:
- Body:
- todo: string
- isCompleted: boolean
-
URL:
/todo/1
-
body
{ "todo": "hi todo", "isCompleted": true }
-
status: 200 OK
-
body
{ "id": 1, "todo": "hi todo", "isCompleted": true }
- URL:
/todo/:id
- Method:
DELETE
- URL:
/todo/1
- body: 없음
- status: 204 No Content
- body: 없음
- URL:
/todo/all
- Method:
DELETE
- status: 204 No Content
- body: 없음