GithubHelp home page GithubHelp logo

dev-hyunsang / todo-list Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 25 KB

๐Ÿ“ Go๋ฅผ ์ด์šฉํ•œ Todo List ๊ฐœ๋ฐœ

Go 57.79% HTML 18.55% JavaScript 23.66%
golang mux-router todo-list-project

todo-list's Introduction

Todo List

Go๋ฅผ ์ด์šฉํ•œ Todo List์„ ๊ฐœ๋ฐœ ํ”„๋กœ์ ํŠธ์ž…๋‹ˆ๋‹ค.
Go๋ฅผ ์ด์šฉํ•˜์—ฌ์„œ CRUD ๋ฐ ๊ธฐ๋ณธ์ ์ธ ๊ฐœ๋…์— ๋Œ€ํ•ด์„œ ๊ณต๋ถ€ ๊ฒธ ๊ฐœ๋ฐœ ํ”„๋กœ์ ํŠธ์ž…๋‹ˆ๋‹ค.

ํ”„๋กœ์ ํŠธ๋ฅผ ์ข…๋ฃŒ ํ•˜์˜€์Šต๋‹ˆ๋‹ค. ํ˜„์žฌ ๋ฐฑ์—”๋“œ์—์„œ์˜ CRUD์— ํ•ด๋‹นํ•˜๋Š” ๋ชจ๋“  ํ”„๋กœ์„ธ์Šค๋Š” ๊ฐœ๋ฐœ ์™„๋ฃŒ ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
ํ”„๋ก ํŠธ์—”๋“œ ๊ฒฝ์šฐ์—๋Š” ์•„์ง ๊ฒฝํ—˜์ด ์ „๋ฌดํ•˜์—ฌ ์ถ”ํ›„์— ์—…๋ฐ์ดํŠธ ์‹œํ‚ฌ ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.

โœจ TODO:

BackEnd

  • /todo: ์ƒˆ๋กœ์šด TODO ๋ฆฌ์ŠคํŠธ ์ถ”๊ฐ€ํ•˜๊ธฐ / POST
    • /todo: index.html๋ฅผ ํ†ตํ•œ ๋ฆฌ์ŠคํŠธ ์ถ”๊ฐ€ํ•˜๊ธฐ / POST
  • /todo: TODO ์ „์ฒด ๋ฆฌ์ŠคํŠธ ์ถœ๋ ฅํ•˜๊ธฐ / GET
  • /todo/{id:[0-9]+}: id ํ•ด๋‹นํ•œ TODO ๋ฆฌ์ŠคํŠธ ์ถœ๋ ฅํ•˜๊ธฐ / GET
  • /todo{id:[0-9]+}: TODO ๋ฆฌ์ŠคํŠธ ์ง€์šฐ๊ธฐ / DELETE
  • /todo: TODO ๋ฆฌ์ŠคํŠธ ์—…๋ฐ์ดํŠธ / PUT
    • /todo/{id:[0-9]+}: Boolํ˜•์„ ํ†ตํ•ด์„œ TODO ํ•ญ๋ชฉ ์ƒํƒœ ์—…๋ฐ์ดํŠธํ•˜๋„๋ก ์ œ์ž‘ / PUT
    • /todo/{id:[0-9]+}: TODOLIST Content ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ๋„๋ก ์ œ์ž‘ / PUT

FrontEnd

  • /todo: index.html๋ฅผ ํ†ตํ•œ ๋ฆฌ์ŠคํŠธ ์ถœ๋ ฅํ•˜๊ธฐ
  • index.html: ๊ฐ ํ•ญ๋ชฉ๋งˆ๋‹ค ๋”ฐ๋กœ๋”ฐ๋กœ ํ‘œ์‹œ
  • index.html: API JSON id๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์ •๋ ฌํ™”
  • index.html: TODO ํ•ญ๋ชฉ ํ”„๋ก ํŠธ์—”๋“œ์—์„œ ์‚ญ์ œ ๊ฐ€๋Šฅํ•˜๋„๋ก ์ œ์ž‘
  • index.html: ์ฒดํฌ ๋ฐ•์Šค๋ฅผ ์ด์šฉํ•˜์—ฌ์„œ Completed ํ•ญ๋ชฉ์— ๋Œ€ํ•œ ์ˆ˜์ • / ์™„๋ฃŒ๋˜์—ˆ๋Š”์ง€ ์•ˆ ์™„๋ฃŒ๋˜์—ˆ์ง€

๊ธฐ๋Šฅ

๋ฌด์—‡์ด ๋” ํšจ๊ณผ์ ์œผ๋กœ ๊ฐœ๋ฐœํ•  ์ˆ˜ ์žˆ๊ณ  ๊ฐ€๋…์„ฑ ์ข‹์€ API๋ฅผ ๋งŒ๋“ค์–ด์•ผ ํ•˜๋Š”์ง€์— ๋Œ€ํ•ด์„œ ๊ณ ๋ฏผํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

URL Methods ์„ค๋ช…
/ GET index.html์— ๋Œ€ํ•ด์„œ ํ™”๋ฉด์— ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
/todo GET ์ถ”๊ฐ€๋œ TODO ํ•ญ๋ชฉ ์ „์ฒด๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.
/todo POST ์ƒˆ๋กœ์šด TODO ํ•ญ๋ชฉ์„ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
/todo/{id:[0-9]+} GET TODO ํ•ญ๋ชฉ์˜ id๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ ํ•ด๋‹น ID๋งŒ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.
/todo/edit/{id:[0-9]+} GET ๊ธฐ์กด TODO ํ•ญ๋ชฉ์˜ id๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค.(ํ˜„์žฌ ๋งˆ์Œ์— ์•ˆ ๋“œ๋Š” ๋ถ€๋ถ„์ด ์žˆ์–ด์„œ ์ˆ˜์ • ์ค‘...)
/todo/{id:[0-9]+} DELETE ๊ธฐ์กด TODO ํ•ญ๋ชฉ์˜ id๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ์„œ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.

์ƒˆ๋กœ์šด TODO ๋ฆฌ์ŠคํŠธ ์ถ”๊ฐ€ํ•˜๊ธฐ

// Request | POST http://localhost:3000/todo 
{
    "content": "Hello" 
}
// Respone
{
    "id": 1,
    "Content": "Hello",
    "Completed": false,
    "created_at": "2021-07-11T15:47:40.890708+09:00"
}

TODO ๋ฆฌ์ŠคํŠธ ์ถœ๋ ฅํ•˜๊ธฐ / GET

// Reqeust / GET http://localhost:3000/todo/1

// Respone
{
    "id": 1,
    "Content": "์ด๊ฒƒ์€ ํ…Œ์ŠคํŠธ~",
    "Completed": false,
    "created_at": "2021-07-11T22:14:31.615345+09:00"
}

todo์— ์ถ”๊ฐ€๋œ ํ•ญ๋ชฉ๋“ค์„ ๋‹ค ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

// Reqeust / GET http://localhost:3000/todo

// Respone
[
    {
        "id": 1,
        "Content": "์ด๊ฒƒ์€ ํ…Œ์ŠคํŠธ~",
        "Completed": false,
        "created_at": "2021-07-12T18:57:16.710946+09:00"
    },
    {
        "id": 2,
        "Content": "์ด๊ฒƒ์€ ํ…Œ์ŠคํŠธ~",
        "Completed": false,
        "created_at": "2021-07-12T18:57:17.115232+09:00"
    },
    {
        "id": 3,
        "Content": "์ด๊ฒƒ์€ ํ…Œ์ŠคํŠธ~",
        "Completed": false,
        "created_at": "2021-07-12T18:57:17.899493+09:00"
    }
]

TODO ๋ฆฌ์ŠคํŠธ ์‚ญ์ œํ•˜๊ธฐ / DLETET

// Reqeust / DLETET http://localhost:3000/todo/1

// Respone
DLETET TODO LIST ID:1

์˜ค๋ฅ˜๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•œ ๋ฐฉ๋ฒ•

๋งŽ์€ ๋ถ„๋“ค๊ป˜์„œ ๋„์™€ ์ฃผ์…จ์Šต๋‹ˆ๋‹ค

์˜ค๋ฅ˜ ํ•ด๊ฒฐ, ์ข‹์€ ํ”„๋กœ์ ํŠธ๋ฅผ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด์„œ ์ฝ์€ ์ž๋ฃŒ๋“ค

todo-list's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.