repositorypackage
0.0.0-20241023095606-b64edb4b6633
Repository: https://github.com/phetployst/book-store-api.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# README
📚 Book Store API
An API for managing a bookstore, built with Go and the Echo framework. This project allows users to browse, create, update, and delete book records.
This project is based on the example-go-api repository. Many concepts and structures were adapted and built upon from this source.
📦️ Packages
go get github.com/DATA-DOG/go-sqlmock
go get github.com/go-playground/validator/v10
go get github.com/google/uuid
go get github.com/labstack/echo/v4
go get github.com/stretchr/testify
go get github.com/swaggo/echo-swagger
go get github.com/swaggo/swag
go get go.uber.org/zap
go get gorm.io/driver/postgres
go get gorm.io/gorm
🚀 Running the Application
- To start the application locally:
go run main.go
- The API will be running at http://localhost:1323.
Running Tests
To run the test suite:
go test ./...
📚 API Documentation
Method | Endpoint | Description |
---|---|---|
GET | /books | Get all books |
GET | /books/:id | Get a specific book |
POST | /books | Add a new book |
PUT | /books/:id | Update a book |
DELETE | /books/:id | Delete a book |
Sample Request
To add a new book:
POST /books
Content-Type: application/json
{
"title": "Clean Code",
"author": "Robert C. Martin",
"isbn": "9780132350884",
}