About | Features | Technologies | Requirements | Starting | License | Author
This is a simple API for a bookstore that basically only has a few endpoints and built with Golang.
βοΈ List
βοΈ Update
βοΈ Delete
The following tools were used in this project:
Before starting π you need to have Git, Go, Docker and GCC installed on your machine.
# Clone this project from GitHub
git clone https://github.com/devenes/go-bookstore-api
# Access the project folder
cd go-bookstore-api
- Start the locally:
go run main.go
docker build -t devenes/bookstore-api:1.0 ./ && docker run -p 8080:8080 -d devenes/bookstore-api:1.0 && explorer "http://localhost:8080/books"
# The server will initialize in the <http://localhost:8080>
- Add a new book:
curl -X POST -H 'content-type: application/json' --data '{"title": "Slim Jim", "author": "Jim"}' http://localhost:8080/books
- Get all books:
curl -X GET http://localhost:8080/books
- Get the book with id:
curl -X GET http://localhost:8080/books/1
- Update a book with id:
curl -X PATCH -H 'content-type: application/json' --data '{"title": "Slim Jim", "author": "James Miller"}' http://localhost:8080/books/1
- Delete the book with id 1:
curl -X DELETE http://localhost:8080/books/1
This project is under license from Apache 2.0. For more details, see the LICENSE file.
Made with β€οΈ by devenes