This is a simple RESTful API for managing a todo list, built with Go. It allows you to create, read, update, and delete todos using go and postgresql (NEON)
GET /todos
- Get all todosGET /todos/id?id
- Get a todo by ID (STUPID ROUTE I KNOW BUT I AM LAZY)POST /todos
- Create a new todoPUT /todos
- Update a todoDELETE /todos?id
- Delete a todo by ID
Just use POSTMAN to test the API. You can also use curl
or any other HTTP client.
e. g.
curl -X POST http://localhost:8080/todos -d '{"title": "Buy milk", "description": "BUY MILK AND DRINK IT" "completed": false}'
And yeah you can run it locally using go run main.go
after adding your database connection string in a sparate .env
file.