This is a simple Todo List application built with Go. It provides a RESTful API to manage tasks.
-
Clone the repository:
git clone https://github.com/manuelbeos/code-branch-todo-test.git cd code-branch-todo-test
-
Install dependencies:
go mod tidy
-
Run the application:
go run cmd/api/main.go
-
The server will start on . http://localhost:8080
- GET
/health
- Response:
¡Server up!
- Response:
- GET
/docs/index.html
- Swagger documentation
-
POST
/tasks
(with random delay)- Request Body:
{ "title": "Task Title", "description": "Task Description" }
- Response:
{ "id": "uuid", "title": "Task Title", "description": "Task Description", "is_completed": false, "created_at": "timestamp", "updated_at": "timestamp" }
- Request Body:
-
GET
/tasks
(with random delay)- Response:
[ { "id": "uuid", "title": "Task Title", "description": "Task Description", "is_completed": false, "created_at": "timestamp", "updated_at": "timestamp" } ]
- Response:
-
GET
/tasks/{id}
- Response:
{ "id": "uuid", "title": "Task Title", "description": "Task Description", "is_completed": false, "created_at": "timestamp", "updated_at": "timestamp" }
- Response:
-
PUT
/tasks/{id}
- Request Body:
{ "title": "Updated Task Title", "description": "Updated Task Description", "is_completed": true }
- Response:
{ "id": "uuid", "title": "Updated Task Title", "description": "Updated Task Description", "is_completed": true, "created_at": "timestamp", "updated_at": "timestamp" }
- Request Body:
-
DELETE
/tasks/{id}
- Response:
204 No Content
- Response:
curl -X POST http://localhost:8080/tasks -H "Content-Type: application/json" -d '{"title": "New Task", "description": "Task Description"}'
Invoke-WebRequest -Uri http://localhost:8080/tasks -Headers @{ "Content-Type" = "application/json" } -Method POST -Body '{"title": "New Task", "description": "Task Description"}'
curl -X GET http://localhost:8080/tasks
Invoke-WebRequest -Uri http://localhost:8080/tasks
curl -X GET http://localhost:8080/tasks/{id}
Invoke-WebRequest -Uri http://localhost:8080/tasks/{id}
curl -X PUT http://localhost:8080/tasks/{id} -H "Content-Type: application/json" -d '{"title": "Updated Task Title", "description": "Updated Task Description", "is_completed": true}'
Invoke-WebRequest -Uri http://localhost:8080/tasks/{id} -Headers @{ "Content-Type" = "application/json" } -Method PUT -Body '{"title": "Updated Task Title", "description": "Updated Task Description", "is_completed": true}'
curl -X DELETE http://localhost:8080/tasks/{id}
Invoke-WebRequest -Uri http://localhost:8080/tasks/{id} -Method DELETE