A very simple api written in go. It uses a postgres db to store books. Uses chi web framework to deal with http requests.
To run the postgres db you will need docker and to create a new volume
docker volume create dbgo
jdbc:postgresql://localhost:5432/godb?sslmode=disable&user=gouser&password=admingres
go run main.go
Add a new book from a fake data file
curl -X POST -d @addbook.json -H "Content-Type: application/json" localhost:8080/books
Get all books
curl localhost:8080/books
Get a book by id
curl localhost:8080/books/1
Update a book by id
curl -X PUT -d @updatebook.json -H "Content-Type: application/json" localhost:8080/books/1
Delete a book by id
curl -X DELETE localhost:8080/books/1