To Clone Project
- git clone https://github.com/shincyls/mytodo.git
Using Docker to Run
- docker pull shincyls/mytodo:test5
- docker compose up OR
- Run with docker desktop
- Search "shincyls/mytodo:test5" and Pull/Download the Container
- Run containers with host port 8080:80
- Browse "http://localhost:8080/api/login/google" in any Internet Browser to Sign-Up as app user
- Once selected your gmail, click sign-in and wait for callback response. Copy the value of "access_token", copy this value as for {YOUR_AUTH_TOKEN}
-
Open Windows CMD / Linux Terminal
- To List All Todo Items
curl -H "Authorization: Bearer {YOUR_AUTH_TOKEN}" http://localhost:8080/api/todos
-
To Select a Todo Item by Id
curl -H "Authorization: Bearer {YOUR_AUTH_TOKEN}" http://localhost:8080/api/todos/{id}
- To Add a Todo Item
curl -H "Authorization: Bearer {YOUR_AUTH_TOKEN}" http://localhost:8080/api/todos/create -X POST -d "title={TASK_TITLE}&description={TASK_DESCRIPTION}&due_date={TASK_DUE_DATE}"
{TASK_TITLE}? task title
{TASK_DESCRIPTION}? task description
{TASK_DUE_DATE}? date format in yyyy-mm-dd - To Mark a Todo Item as Completed
curl -H "Authorization: Bearer {YOUR_AUTH_TOKEN}" http://localhost:8080/api/todos/{id}/done -X PUT
{id}? id of todo item, you can view it with command (i) (Refer to List All Todo Items)
- To Remove a Todo Item
curl -H "Authorization: Bearer {YOUR_AUTH_TOKEN}" http://localhost:8080/api/todos/{id} -X DELETE
{id}? id of todo item, you can view it with command (i) (Refer to List All Todo Items)
- To List All Todo Items