- cd repo/cmd/server
- go run main.go
-
GET
/tasks
- Returns an array of tasks
-
GET
/task/{id:[0-9]+}
- Returns a specific task
-
POST
/task
- Create task
- Request Body (JSON):
{ "desc": "Task Description", "isDone": true/false }
-
PUT
/task
- Update task
- Request Body (JSON):
{ "id": <task_id> (number), "desc": "<task desc>" (string), "isDone": true/false }
-
DELETE
/task/{id:[0-9]+}
- Delete task
-
PUT
/task/{id:[0-9]+}
- Toggle task done status
- cd repo
- go build -o todo_cli ./cmd/cli this will generate todo_cli executable in root location of repo
- ./todo_cli -h
- Get All todos
./todo_cli get_all
- Get todo by id
./todo_cli -id <todo_id> get
- Create todo
./todo_cli -title "your title" create
- Mark todo as done
./todo_cli -id <todo_id> mark_done
- Delete todo
./todo_cli -id <todo_id> delete