Todo API is a small todo api backend built in Go
Use the endpoint using POST request
ec2-18-144-22-131.us-west-1.compute.amazonaws.com:8000/api/create
Pass in json
{
"name":"Buy bread"
}
Use the endpoint using GET request
ec2-18-144-22-131.us-west-1.compute.amazonaws.com:8000/api/todos
Use the endpoint using PUT request
ec2-18-144-22-131.us-west-1.compute.amazonaws.com:8000/api/update
Pass in json
{
"id": 1,
"name": "Buy bread",
"finished": true
}
Use the endpoint using DELETE request
ec2-18-144-22-131.us-west-1.compute.amazonaws.com:8000/api/delete
Pass in json
{
"ids": [1]
}
Will need to run so we have a db to use
docker compose up postgresdb
install goose
go install github.com/pressly/goose/v3/cmd/goose@latest
or on mac
brew install goose
cd into migration folder
cd internal/repositories/db/migrations
Run:
goose postgres "user=<user> password=<password> dbname=<db name> sslmode=disable" up
You can clone and run locally Just edit the .env file and make sure docker is installed and run
docker compose up