Korean Dummy JSONμ νκ΅μ΄ κΈ°λ°μ λλ―Έ λ°μ΄ν°λ₯Ό μ 곡νκΈ° μν΄ μ μλ νλ‘μ νΈλ‘, JSONPlaceholderμ μκ°μ λ°μ κ°λ°λμμ΅λλ€.
νκ΅μ΄λ‘ ꡬμ±λ λ°μ΄ν°λ₯Ό ν΅ν΄ κ°λ°μλ€μ΄ λ³΄λ€ νμ€μ μΈ λλ―Έ λ°μ΄ν°λ₯Ό μ 곡 λ°μ μ μμ΅λλ€.
μΆκ°λ‘ JWT κΈ°λ° λ‘κ·ΈμΈ λ° μΈμ¦/μΈκ° λλ―Έ API λ° λμ λλ―Έ μ΄λ―Έμ§ μμ± APIκ° μ 곡λ©λλ€.
κ°μ ν νμμμ΄ κ°νΈνκ² λ°λ‘ μ¬μ©ν μ μμ΅λλ€.
GET, POST, PUT, PATCH, DELETE μμ²μ 보λ΄κ³ μ§μ ν μ€νΈ ν΄λ³΄κ³ νμ΅ν΄ 보μΈμ.
π κ°λ° κΈ°κ° : 2024. 08. 27. ~ 2024. 09. 14.
π λ°°ν¬ URL : π Korean Dummy JSON
β νμ¬ νλ‘μ νΈλ λ¬΄λ£ DB μλ²λ₯Ό μ¬μ©νκ³ μμ΄, μΌμμ μΌλ‘ API μμ²μ΄ μ€λ¨λ μ μμ΅λλ€.
νλ‘ νΈμλ | 벑μλ | DB | λμμΈ | λ°°ν¬, κ΄λ¦¬ |
---|---|---|---|---|
users, posts, comments, todos, books, reviews, auth 7κ°μ 리μμ€κ° μ 곡λ©λλ€.
Resource | Information |
---|---|
/users | μ μ 20λͺ |
/posts | κ²μλ¬Ό 100κ° |
/comments | λκΈ 500κ° |
/todos | ν μΌ 200κ° |
/books | μ± 100κ° |
/reviews | 리뷰 500κ° |
/auth | λ‘κ·ΈμΈ λ° μΈμ¦/μΈκ° |
/image | λμ λλ―Έ μ΄λ―Έμ§ μμ± |
μμ μ½λμμλ Fetch APIλ₯Ό μ¬μ©ν©λλ€.
κ° μμ μ½λλ₯Ό 볡μ¬ν ν λΈλΌμ°μ μ½μμμ μ€νν΄ λ³΄μΈμ.
μμΈν μ¬μ©λ²μ μκ³ μΆμΌμλ©΄ 리μμ€λ³ πDocs νμ΄μ§λ₯Ό μ°Έκ³ ν΄ μ£ΌμΈμ.
fetch("https://koreandummyjson.site/api/posts/1")
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error fetching data:", error));
κ²°κ³Ό
{
"message": "κ²μλ¬Ό μ‘°ν μ±κ³΅",
"post": {
"id": 1,
"title": "μμΈμ μ¨κ²¨μ§ λͺ
μ",
"content": "μμΈμλ μ μλ €μ§μ§ μμ λ©μ§ λͺ
μκ° λ§λ€. μ΅κ·Όμ λ°©λ¬Έν μμ μΉ΄νμ μ‘°μ©ν 곡μμ΄ νΉν κΈ°μ΅μ λ¨λλ€. μ΄κ³³μ 볡μ‘ν λμλ₯Ό λ²μ΄λ ννλ‘μ΄ μκ°μ λ³΄λΌ μ μλ μλ²½ν μ₯μμλ€. νΉν, λ°λ»ν μ°¨μ ν¨κ» μ°½λ°μ λ°λΌλ³΄λ©° μ±
μ μ½λ μκ°μ΄ μ λ§ ν볡νλ€.",
"imgUrl": "https://picsum.photos/id/1/300/300",
"createdAt": "2024-01-01T08:00:00.000Z",
"userId": 1
}
}
fetch("https://koreandummyjson.site/api/posts")
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error fetching data:", error));
κ²°κ³Ό
{
"message": "κ²μλ¬Ό λͺ©λ‘ μ‘°ν μ±κ³΅",
"posts": [
{
"id": 1,
"title": "μμΈμ μ¨κ²¨μ§ λͺ
μ",
"content": "μμΈμλ μ μλ €μ§μ§ μμ λ©μ§ λͺ
μκ° λ§λ€. μ΅κ·Όμ λ°©λ¬Έν μμ μΉ΄νμ μ‘°μ©ν 곡μμ΄ νΉν κΈ°μ΅μ λ¨λλ€. μ΄κ³³μ 볡μ‘ν λμλ₯Ό λ²μ΄λ ννλ‘μ΄ μκ°μ λ³΄λΌ μ μλ μλ²½ν μ₯μμλ€. νΉν, λ°λ»ν μ°¨μ ν¨κ» μ°½λ°μ λ°λΌλ³΄λ©° μ±
μ μ½λ μκ°μ΄ μ λ§ ν볡νλ€.",
"imgUrl": "https://picsum.photos/id/1/300/300",
"createdAt": "2024-01-01T08:00:00.000Z",
"userId": 1
},
{
"id": 2,
"title": "μ¬λ¦ λ°λ€μ 맀λ ₯",
"content": "μ¬λ¦μ΄ λ€κ°μ€λ©΄μ λ°λ€λ₯Ό μ°Ύλ μ¬λλ€λ‘ κ°λνλ€. λ°λ·κ°μμμ ν루λ μΈμ λ νΉλ³νλ€. λͺ¨λμ¬μ₯ μλ₯Ό κ±·κ³ , νλ μ리λ₯Ό λ€μΌλ©°, μμν λ°λμ λ§λ μκ°λ€μ μμ μ μλ κΈ°μ΅μ΄ λλ€. νΉν, μΌλͺ° λ λ°λ€λ₯Ό λ°λΌλ³΄λ©° μ°μ μ¬μ§μ λ무 μλ¦λ€μ λ€.",
"imgUrl": "https://picsum.photos/id/2/300/300",
"createdAt": "2024-01-03T09:00:00.000Z",
"userId": 2
},
...
]
}
fetch("https://koreandummyjson.site/api/posts?page=1&limit=10")
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error fetching data:", error));
κ²°κ³Ό
{
"message": "κ²μλ¬Ό λͺ©λ‘ μ‘°ν μ±κ³΅",
"posts": [
{
"id": 1,
"title": "μμΈμ μ¨κ²¨μ§ λͺ
μ",
"content": "μμΈμλ μ μλ €μ§μ§ μμ λ©μ§ λͺ
μκ° λ§λ€. μ΅κ·Όμ λ°©λ¬Έν μμ μΉ΄νμ μ‘°μ©ν 곡μμ΄ νΉν κΈ°μ΅μ λ¨λλ€. μ΄κ³³μ 볡μ‘ν λμλ₯Ό λ²μ΄λ ννλ‘μ΄ μκ°μ λ³΄λΌ μ μλ μλ²½ν μ₯μμλ€. νΉν, λ°λ»ν μ°¨μ ν¨κ» μ°½λ°μ λ°λΌλ³΄λ©° μ±
μ μ½λ μκ°μ΄ μ λ§ ν볡νλ€.",
"imgUrl": "https://picsum.photos/id/1/300/300",
"createdAt": "2024-01-01T08:00:00.000Z",
"userId": 1
},
{
"id": 2,
"title": "μ¬λ¦ λ°λ€μ 맀λ ₯",
"content": "μ¬λ¦μ΄ λ€κ°μ€λ©΄μ λ°λ€λ₯Ό μ°Ύλ μ¬λλ€λ‘ κ°λνλ€. λ°λ·κ°μμμ ν루λ μΈμ λ νΉλ³νλ€. λͺ¨λμ¬μ₯ μλ₯Ό κ±·κ³ , νλ μ리λ₯Ό λ€μΌλ©°, μμν λ°λμ λ§λ μκ°λ€μ μμ μ μλ κΈ°μ΅μ΄ λλ€. νΉν, μΌλͺ° λ λ°λ€λ₯Ό λ°λΌλ³΄λ©° μ°μ μ¬μ§μ λ무 μλ¦λ€μ λ€.",
"imgUrl": "https://picsum.photos/id/2/300/300",
"createdAt": "2024-01-03T09:00:00.000Z",
"userId": 2
},
...
],
"page": 1,
"limit": 10,
"hasNextPage": true
}
fetch("https://koreandummyjson.site/api/posts", {
method: "POST",
body: JSON.stringify({
title: "ν
μ€νΈ κΈ",
content: "ν
μ€νΈ κΈ μ
λλ€.",
imgUrl: "https://picsum.photos/id/1/300/300",
userId: 1
}),
headers: {
"Content-Type": "application/json"
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error fetching data:", error));
κ²°κ³Ό
{
"message": "κ²μλ¬Ό μμ± μ±κ³΅",
"post": {
"id": 101,
"title": "ν
μ€νΈ κΈ",
"content": "ν
μ€νΈ κΈ μ
λλ€.",
"imgUrl": "https://picsum.photos/id/1/300/300",
"createdAt": "2024-09-07T16:09:43.814Z",
"userId": 1
}
}
fetch("https://koreandummyjson.site/api/posts/1", {
method: "PUT",
body: JSON.stringify({
title: "ν
μ€νΈ κΈ",
contnet: "ν
μ€νΈ κΈ μ
λλ€.",
imgUrl: "https://picsum.photos/id/2/300/300"
}),
headers: {
"Content-Type": "application/json"
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error fetching data:", error));
κ²°κ³Ό
{
"message": "κ²μλ¬Ό μμ μ±κ³΅",
"post": {
"id": 1,
"title": "ν
μ€νΈ κΈ",
"imgUrl": "https://picsum.photos/id/2/300/300",
"createdAt": "2024-01-01T08:00:00.000Z",
"userId": 1
}
}
fetch("https://koreandummyjson.site/api/posts/1", {
method: "PATCH",
body: JSON.stringify({
title: "ν
μ€νΈ κΈ"
}),
headers: {
"Content-Type": "application/json"
}
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error fetching data:", error));
κ²°κ³Ό
{
"message": "κ²μλ¬Ό μμ μ±κ³΅",
"post": {
"id": 1,
"title": "ν
μ€νΈ κΈ",
"content": "μμΈμλ μ μλ €μ§μ§ μμ λ©μ§ λͺ
μκ° λ§λ€. μ΅κ·Όμ λ°©λ¬Έν μμ μΉ΄νμ μ‘°μ©ν 곡μμ΄ νΉν κΈ°μ΅μ λ¨λλ€. μ΄κ³³μ 볡μ‘ν λμλ₯Ό λ²μ΄λ ννλ‘μ΄ μκ°μ λ³΄λΌ μ μλ μλ²½ν μ₯μμλ€. νΉν, λ°λ»ν μ°¨μ ν¨κ» μ°½λ°μ λ°λΌλ³΄λ©° μ±
μ μ½λ μκ°μ΄ μ λ§ ν볡νλ€.",
"imgUrl": "https://picsum.photos/id/1/300/300",
"createdAt": "2024-01-01T08:00:00.000Z",
"userId": 1
}
}
fetch("https://koreandummyjson.site/api/posts/1", {
method: "DELETE"
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error fetching data:", error));
κ²°κ³Ό
{
"message": "1λ² κ²μλ¬Ό μμ μ±κ³΅"
}
fetch("https://koreandummyjson.site/api/posts/?userId=1")
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error fetching data:", error));
κ²°κ³Ό
{
"message": "κ²μλ¬Ό λͺ©λ‘ μ‘°ν μ±κ³΅",
"posts": [
{
"id": 1,
"title": "μμΈμ μ¨κ²¨μ§ λͺ
μ",
"content": "μμΈμλ μ μλ €μ§μ§ μμ λ©μ§ λͺ
μκ° λ§λ€. μ΅κ·Όμ λ°©λ¬Έν μμ μΉ΄νμ μ‘°μ©ν 곡μμ΄ νΉν κΈ°μ΅μ λ¨λλ€. μ΄κ³³μ 볡μ‘ν λμλ₯Ό λ²μ΄λ ννλ‘μ΄ μκ°μ λ³΄λΌ μ μλ μλ²½ν μ₯μμλ€. νΉν, λ°λ»ν μ°¨μ ν¨κ» μ°½λ°μ λ°λΌλ³΄λ©° μ±
μ μ½λ μκ°μ΄ μ λ§ ν볡νλ€.",
"imgUrl": "https://picsum.photos/id/1/300/300",
"createdAt": "2024-01-01T08:00:00.000Z",
"userId": 1
},
{
"id": 21,
"title": "μ¬νμ μΆμ΅",
"content": "μ¬ν μ€ μ΄¬μν μ¬μ§λ€μ 보며 κ·Έλμ μΆμ΅μ΄ μλ‘μλ‘ λ μ€λ₯Έλ€. νΉν, κ·Έ μ§μμ μλ¦λ€μ΄ νκ²½κ³Ό νμ§ μμλ€μ μμ μ μλ κ²½νμ΄μλ€. μ¬νμ ν΅ν΄ μ»μ μμ€ν κΈ°μ΅λ€μ κ³μ κ°μ§νκ³ μΆλ€.",
"imgUrl": "https://picsum.photos/id/21/300/300",
"createdAt": "2024-04-11T12:00:00.000Z",
"userId": 1
},
{
"id": 41,
"title": "μμΈμ λͺ
μ νλ°©",
"content": "μμΈμ λ€μν λͺ
μλ₯Ό νλ°©νλ κ²μ μΈμ λ μ¦κ±°μ΄ μΌμ΄λ€. μ€λμ λ¨μ°νμλ₯Ό λ°©λ¬Ένμ¬ μμΈμ μ κ²½μ κ°μνκ³ , λ§μλ μμμ μ¦κΈ°λ©° μ’μ μκ°μ 보λλ€.",
"imgUrl": "https://picsum.photos/id/41/300/300",
"createdAt": "2024-07-05T16:00:00.000Z",
"userId": 1
},
{
"id": 61,
"title": "μμΈμ μμ¬ νλ°©",
"content": "μμΈμ μμ¬λ₯Ό νλ°©νλ κ²μ ν₯λ―Έλ‘μ΄ κ²½νμ΄λ€. μ€λμ μμΈμ κ³ κΆμ λ°©λ¬Ένμ¬ μμ¬μ νμ μ λκΌλ€. κ³Όκ±°μ νμ¬κ° λ§λλ μ₯μμμ λ§μ κ²μ λ°°μ λ€.",
"imgUrl": "https://picsum.photos/id/61/300/300",
"createdAt": "2024-08-11T18:00:00.000Z",
"userId": 1
},
{
"id": 81,
"title": "κ°μμ νκ²½",
"content": "κ°μμ΄ κΉμ΄μ§λ©΄μ μμ°μ΄ ν©κΈλΉμΌλ‘ λ¬Όλ€μ΄ κ°λ€. μ€λμ 곡μμμ λ
Έλ μνλ무λ₯Ό 보며 κ°μμ μ μ·¨λ₯Ό λ§λ½νλ€. μ΄λ° μκ°λ€μ΄ κ°μμ λμ± νΉλ³νκ² λ§λ λ€.",
"imgUrl": "https://picsum.photos/id/81/300/300",
"createdAt": "2024-09-10T08:00:00.000Z",
"userId": 1
}
]
}
fetch("https://koreandummyjson.site/api/posts/1/comments")
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error fetching data:", error));
κ²°κ³Ό
{
{
"message": "κ²μλ¬Ό λκΈ λͺ©λ‘ μ‘°ν μ±κ³΅",
"comments": [
{
"id": 1,
"commentId": 1,
"content": "μ λ§ μ μ΅ν κ²μλ¬Όμ
λλ€!",
"createdAt": "2024-04-11T12:01:00.000Z"
},
{
"id": 1,
"commentId": 2,
"content": "μ’μ μ 보 κ°μ¬ν©λλ€.",
"createdAt": "2024-04-11T12:03:00.000Z"
},
{
"id": 1,
"commentId": 3,
"content": "μ΄ μ£Όμ μ λν΄ λ μκ³ μΆμ΄μ.",
"createdAt": "2024-04-11T12:06:00.000Z"
},
{
"id": 1,
"commentId": 4,
"content": "λμμ΄ λ§μ΄ λμμ΄μ.",
"createdAt": "2024-04-11T12:10:00.000Z"
},
{
"id": 1,
"commentId": 5,
"content": "μ μ½μμ΅λλ€.",
"createdAt": "2024-04-11T12:15:00.000Z"
}
]
}
}
μλμ κ°μ νμ΄μ§λ€μ΄μ endpointsλ₯Ό μ 곡ν©λλ€.
Endpoint | Method | Action |
---|---|---|
/users?page={page}&limit={limit} | GET | μ μ λͺ©λ‘ νμ΄μ§ |
/todos?page={page}&limit={limit} | GET | ν μΌ λͺ©λ‘ νμ΄μ§ |
/posts?page={page}&limit={limit} | GET | κ²μλ¬Ό λͺ©λ‘ νμ΄μ§ |
/comments?page={page}&limit={limit} | GET | λκΈ λͺ©λ‘ νμ΄μ§ |
/books?page={page}&limit={limit} | GET | μ± λͺ©λ‘ νμ΄μ§ |
/reviews?page={page}&limit={limit} | GET | 리뷰 λͺ©λ‘ νμ΄μ§ |
μλμ κ°μ νν°λ§ endpointsλ₯Ό μ 곡ν©λλ€.
Endpoint | Method | Action |
---|---|---|
/todos?userId={userId} | GET | μ μ λ³ ν μΌ λͺ©λ‘ |
/comments?userId={userId} | GET | μ μ λ³ λκΈ λͺ©λ‘ |
/comments?postId={postId} | GET | κ²μλ¬Όλ³ λκΈ λͺ©λ‘ |
/reviews?bookId={bookId} | GET | μ± λ³ λ¦¬λ·° λͺ©λ‘ |
/reviews?userId={userId} | GET | μ μ λ³ λ¦¬λ·° λͺ©λ‘ |
μλμ κ°μ νμ endpointsλ₯Ό μ 곡ν©λλ€.
Endpoint | Method | Action |
---|---|---|
/users/:id/todos | GET | μ μ λ³ ν μΌ λͺ©λ‘ μ‘°ν |
/users/:id/posts | GET | μ μ λ³ κ²μλ¬Ό λͺ©λ‘ μ‘°ν |
/users/:id/comment | GET | μ μ λ³ λκΈ λͺ©λ‘ μ‘°ν |
/users/:id/reviews | GET | μ μ λ³ λ¦¬λ·° λͺ©λ‘ μ‘°ν |
/posts/:id/comments | GET | κ²μλ¬Όλ³ λκΈ λͺ©λ‘ μ‘°ν |
/books/:id/reviews | GET | μ± λ³ λ¦¬λ·° λͺ©λ‘ μ‘°ν |
Endpoint | Method | Action |
---|---|---|
/users/:id | GET | μ μ μ‘°ν |
/users | GET | μ μ λͺ©λ‘ |
/users?page={page}&limit={limit} | GET | μ μ λͺ©λ‘ νμ΄μ§ |
/users/:id/todos | GET | μ μ ν μΌ λͺ©λ‘ μ‘°ν |
/users/:id/posts | GET | μ μ κ²μλ¬Ό λͺ©λ‘ μ‘°ν |
/users/:id/comments | GET | μ μ λκΈ λͺ©λ‘ μ‘°ν |
/users/:id/books | GET | μ μ μ± λͺ©λ‘ μ‘°ν |
/users/:id/reviews | GET | μ μ 리뷰 λͺ©λ‘ μ‘°ν |
/users | POST | μ μ μμ± |
/users/:id | PUT | μ μ μμ |
/users/:id | PATCH | μ μ μμ |
/users/:id | DELETE | μ μ μμ |
/todos/:id | GET | ν μΌ μ‘°ν |
/todos | GET | ν μΌ λͺ©λ‘ |
/todos?userId={userId} | GET | μ μ ν μΌ λͺ©λ‘ νν°λ§ |
/todos?page={page}&limit={limit} | GET | ν μΌ λͺ©λ‘ νμ΄μ§ |
/todos | POST | ν μΌ μμ± |
/todos/:id | PUT | ν μΌ μμ |
/todos/:id | PATCH | ν μΌ μμ |
/todos/:id | DELETE | ν μΌ μμ |
/posts/:id | GET | κ²μλ¬Ό μ‘°ν |
/posts | GET | κ²μλ¬Ό λͺ©λ‘ |
/posts?page={page}&limit={limit} | GET | κ²μλ¬Ό λͺ©λ‘ νμ΄μ§ |
/posts/:id/comments | GET | κ²μλ¬Ό λκΈ λͺ©λ‘ μ‘°ν |
/posts?userId={userId} | GET | μ μ κ²μλ¬Ό λͺ©λ‘ νν°λ§ |
/posts | POST | κ²μλ¬Ό μμ± |
/posts/:id | PUT | κ²μλ¬Ό μμ |
/posts/:id | PATCH | κ²μλ¬Ό μμ |
/posts/:id | DELETE | κ²μλ¬Ό μμ |
/comments/:id | GET | λκΈ μ‘°ν |
/comments | GET | λκΈ λͺ©λ‘ |
/comments?page={page}&limit={limit} | GET | λκΈ λͺ©λ‘ νμ΄μ§ |
/comments?userId={userId} | GET | μ μ λκΈ λͺ©λ‘ νν°λ§ |
/comments?postId={postId} | GET | κ²μλ¬Ό λκΈ λͺ©λ‘ νν°λ§ |
/comments | POST | λκΈ μμ± |
/comments/:id | PUT | λκΈ μμ |
/comments/:id | PATCH | λκΈ μμ |
/comments/:id | DELETE | λκΈ μμ |
/books/:id | GET | μ± μ‘°ν |
/books | GET | μ± λͺ©λ‘ |
/books?page={page}&limit={limit} | GET | μ± λͺ©λ‘ νμ΄μ§ |
/books/:id/reviews | GET | μ± λ¦¬λ·° λͺ©λ‘ μ‘°ν |
/books | POST | μ± μμ± |
/books/:id | PUT | μ± μμ |
/books/:id | PATCH | μ± μμ |
/books/:id | DELETE | μ± μμ |
/reviews/:id | GET | 리뷰 μ‘°ν |
/reviews | GET | 리뷰 λͺ©λ‘ |
/reviews?page={page}&limit={limit} | GET | 리뷰 λͺ©λ‘ νμ΄μ§ |
/reviews?userId={userId} | GET | μ μ 리뷰 νν°λ§ |
/reviews?bookId={bookId} | GET | μ± λ¦¬λ·° νν°λ§ |
/reviews | POST | 리뷰 μμ± |
/reviews/:id | PUT | 리뷰 μμ |
/reviews/:id | PATCH | 리뷰 μμ |
/reviews/:id | DELETE | 리뷰 μμ |
/auth/login | POST | λ‘κ·ΈμΈ |
/auth/user | GET | μ μ μ‘°ν |
/auth/refresh | GET | ν ν° μ¬λ°κΈ |
/image/:size/:bgColor/:text.{ext}/:textColor | GET | λμ λλ―Έ μ΄λ―Έμ§ μμ± |