sangminlee98 / api-practice

프론트엔드 API 연동 세션을 위한 실습 레포입니다.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MacOS 유저 설정 (필수)

todo-server/docker-compose.yml 파일 수정

21번째 줄
(기존) image: tkdals0978/todo-server
(수정) image: tkdals0978/todo-server-mac

서버 시작하기

$ git clone https://github.com/sangminlee98/api-practice.git
$ cd api-practice/todo-server
$ docker-compose up -d

API 명세

스크린샷 2023-07-11 오전 4 21 15

1. getTodos

Request

  • URL: api/todos
  • Method: GET

Response

{
  "todos": [
    {
      "id": 1,
      "title": "할일 1",
      "done": false,
      "thumbnail": "https:// ~"
    },
    {
      "id": 2,
      "title": "할일 2",
      "done": true,
      "thumbnail": "https:// ~"
    },
    {
      "id": 3,
      "title": "할일 3",
      "done": false,
      "thumbnail": "https:// ~"
    }
  ]
}

2. createTodo

Request

  • URL: api/todos
  • Method: POST
  • Content-Type: multipart/form-data
  • Body:
    • todoData: string
    • file?: File

Response

{
  "id": 1,
  "title": "할일 1",
  "done": false,
  "thumbnail": "https:// ~"
}

3. updateTodo

Request

  • URL: api/todos/:id
  • Method: PUT

Response

{
  "id": 1,
  "title": "할일 1",
  "done": false,
  "thumbnail": "https:// ~"
}

4. deleteTodo

Request

  • URL: api/todos/:id
  • Method: DELETE

Response

없음

About

프론트엔드 API 연동 세션을 위한 실습 레포입니다.


Languages

Language:JavaScript 53.3%Language:Java 36.0%Language:HTML 7.4%Language:CSS 2.7%Language:Dockerfile 0.5%