Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devenes/go-bookstore-api
This is a simple API for a bookstore that basically only has a few endpoints and built with Golang.
https://github.com/devenes/go-bookstore-api
docker go goland golang sqlite
Last synced: 10 days ago
JSON representation
This is a simple API for a bookstore that basically only has a few endpoints and built with Golang.
- Host: GitHub
- URL: https://github.com/devenes/go-bookstore-api
- Owner: devenes
- License: apache-2.0
- Created: 2022-06-10T22:02:17.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T00:29:29.000Z (over 1 year ago)
- Last Synced: 2024-06-21T09:38:47.911Z (5 months ago)
- Topics: docker, go, goland, golang, sqlite
- Language: Go
- Homepage:
- Size: 157 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Bookstore API
🚧 Go Bookstore Api 🚀 Under construction... 🚧
About |
Features |
Technologies |
Requirements |
Starting |
License |
Author
## :dart: About ##
This is a simple API for a bookstore that basically only has a few endpoints and built with Golang.
## :sparkles: Features ##
:heavy_check_mark: List \
:heavy_check_mark: Update \
:heavy_check_mark: Delete## :rocket: Technologies ##
The following tools were used in this project:
- [Go](https://golang.org/)
- [Gin](https://gin-gonic.com/)
- [Gorm](https://gorm.io/)
- [SQLite](https://www.sqlite.org/)
- [GitHub](https://github.com/)## :white_check_mark: Requirements ##
Before starting :checkered_flag: you need to have [Git](https://git-scm.com), [Go](https://golang.org), [Docker](https://www.docker.com/) and [GCC](https://gcc.gnu.org/) installed on your machine.
## :checkered_flag: Starting ##
```bash
# 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:
```bash
go run main.go
```- ## 🐳 Start the server in a Docker container:
```bash
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
```- Add a new book:
```bash
curl -X POST -H 'content-type: application/json' --data '{"title": "Slim Jim", "author": "Jim"}' http://localhost:8080/books
```
- Get all books:
```bash
curl -X GET http://localhost:8080/books
```- Get the book with id:
```bash
curl -X GET http://localhost:8080/books/1
```- Update a book with id:
```bash
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:
```bash
curl -X DELETE http://localhost:8080/books/1
```### Resources:
- [Go](https://golang.org/)
- [Rest API](https://blog.logrocket.com/how-to-build-a-rest-api-with-golang-using-gin-and-gorm/)## :memo: License ##
This project is under license from Apache 2.0. For more details, see the [LICENSE](LICENSE) file.
Made with :heart: by devenes