JS ํฌ๋๋ฆฌ์คํธ ์คํ
2
์๋ฐ์คํฌ๋ฆฝํธ์ AJAX๋ฅผ ์ด์ฉํ์ฌ ๊ตฌํ ํ๋ ํฌ๋๋ฆฌ์คํธ
๐ฅ๏ธ ๋ฐ๋ชจ ๋งํฌ
๐ฏ๐ฏ ์ฌํ ์๊ตฌ์ฌํญ
๐ต๏ธโโ๏ธ ์ ์ฝ์ฌํญ
method
uri
GET
/api/users
method
uri
POST
/api/users
{
requestBody : {
"name" : "string"
} ,
response : {
"_id" : "string" ,
"name" : "string" ,
"todoList" : [ ]
}
}
method
uri
GET
/api/users/:userId
{
response : {
"_id" : "string" ,
"name" : "string" ,
"todoList" : [ ...]
}
}
method
uri
DELETE
/api/users/:userId
User์ Todo Item ๋ถ๋ฌ์ค๊ธฐ
method
uri
GET
/api/users/:userId/items/
User์ Todo Item ์ถ๊ฐํ๊ธฐ
method
uri
POST
/api/users/:userId/items/
{
requestBody : {
"contents" : "string"
} ,
response : {
"_id" : "string" ,
"name" : "string" ,
"todoList" : [ ...]
}
}
User์ Todo Item ์ ๋ถ ์ญ์ ํ๊ธฐ
method
uri
DELETE
/api/users/:userId/items/
{
response : {
"_id" : "string" ,
"name" : "string" ,
"todoList" : [ ]
}
}
User์ Todo Item 1๊ฐ ์ญ์ ํ๊ธฐ
method
uri
DELETE
/api/users/:userId/items/:itemId
{
response : {
"_id" : "string" ,
"name" : "string" ,
"todoList" : [ ...]
}
}
User์ Todo Item ๋ด์ฉ ์์ ํ๊ธฐ
method
uri
PUT
/api/users/:userId/items/:itemId
{
requestBody : {
"contents" : "string"
} ,
response : {
"_id" : "string" ,
"contents" : "string" ,
"priority" : "string" ,
"isCompleted" : "boolean"
}
}
User์ Todo Item ์ฐ์ ์์ ์์ ํ๊ธฐ
method
uri
PUT
/api/users/:userId/items/:itemId/priority
{
requestBody : {
"priority" : "string" // 'NONE', 'FIRST', 'SECOND'
} ,
response : {
"_id" : "string" ,
"contents" : "string" ,
"priority" : "string" ,
"isCompleted" : "boolean"
}
}
User์ Todo Item complete toggle
method
uri
PUT
/api/users/:userId/items/:itemId/toggle
{
response : {
"_id" : "string" ,
"contents" : "string" ,
"priority" : "string" ,
"isCompleted" : "boolean"
}
}
๋ก์ปฌ์์ ์๋ฒ ๋์์ ์์ฝ๊ฒ static resources ๋ณ๊ฒฝ ๋ฐ ํ์ธํ๋ ๋ฐฉ๋ฒ
๋ก์ปฌ์์ ์น์๋ฒ๋ฅผ ๋์ html, css, js ๋ฑ์ ์ค์๊ฐ์ผ๋ก ์์ฝ๊ฒ ํ
์คํธํด ๋ณผ ์ ์์ต๋๋ค. ์ด๋ฅผ ์ํด์๋ ์ฐ์ npm์ด ์ค์น๋์ด ์์ด์ผ ํฉ๋๋ค. ๊ตฌ๊ธ์ npm install ์ด๋ ํค์๋๋ก ๊ฐ์์ ์ด์์ฒด์ ์ ๋ง๊ฒ๋ npm์ ์ค์นํด์ฃผ์ธ์. ์ดํ ์๋์ ๋ช
๋ น์ด๋ฅผ ํตํด ์ค์๊ฐ์ผ๋ก ์นํ์ด์ง๋ฅผ ํ
์คํธํด๋ณผ ์ ์์ต๋๋ค.
npm install -g live-server
์คํ์ ์๋์ ์ปค๋งจ๋๋ก ํ ์ ์์ต๋๋ค.
๋ง์ฝ ๋ฏธ์
์ํ ์ค์ ๊ฐ์ ์ฌํญ์ด ๋ณด์ธ๋ค๋ฉด, ์ธ์ ๋ ์์ ๋กญ๊ฒ PR์ ๋ณด๋ด์ฃผ์ธ์.
๋ฒ๊ทธ๋ฅผ ๋ฐ๊ฒฌํ๋ค๋ฉด, Issues ์ ๋ฑ๋กํด์ฃผ์ธ์.
This project is MIT licensed.