A simple RESTful API built with Go, Gin, and Mux for managing a bookstore's resources.
Prerequisites
- Go - Install the latest version available from the official website
- Git - To clone the repository
- Clone the repository:
git clone https://github.com/your-username/yoour-repo-name.git
cd go-bookstore
- Install the required packages: Copy code
go get -v
- Run the application:
go run cmd/main/main.go
Create a Book
- Endpoint:
POST /book/
- Request Body:
{
"title": "Book Title",
"author": "Author Name",
"publication": "Publisher Name"
}
- Response:
{
"id": "0123456789",
"title": "Book Title",
"author": "Author Name",
"publication": "Publisher Name"
}
-
Endpoint:
GET /book/
Get a list of Books -
Endpoint:
GET /book/{bookId}
Get a Book by ID -
Endpoint:
PUT /book/{bookId}
Update a Book by ID -
Endpoint:
DELETE /book/{bookId}
Delete a Book by ID
Feel free to submit a pull request or open an issue to contribute to the project. Make sure to include a detailed description of the changes and any relevant context.
This project is open source and licensed under the MIT License.
If you have any questions, feel free to reach out to the maintainer at [email protected].