devenes / go-bookstore-api

This is a simple API for a bookstore that basically only has a few endpoints and built with Golang.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go Bookstore Api

Bookstore API

Build Tool Tool Tool Github top language Github language count Repository size License

🚧 Go Bookstore Api πŸš€ Under construction... 🚧


About   |   Features   |   Technologies   |   Requirements   |   Starting   |   License   |   Author


🎯 About

This is a simple API for a bookstore that basically only has a few endpoints and built with Golang.

✨ Features

βœ”οΈ List
βœ”οΈ Update
βœ”οΈ Delete

πŸš€ Technologies

The following tools were used in this project:

βœ… Requirements

Before starting 🏁 you need to have Git, Go, Docker and GCC installed on your machine.

🏁 Starting

# 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
  • 🐳 Start the server in a Docker container:

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

Resources:

πŸ“ License

This project is under license from Apache 2.0. For more details, see the LICENSE file.

Made with ❀️ by devenes

 

⬆️ Back to top

About

This is a simple API for a bookstore that basically only has a few endpoints and built with Golang.

License:Apache License 2.0


Languages

Language:Go 90.4%Language:Dockerfile 9.6%