This is a simple Book API implemented in Golang.
This is a simple Book API implemented in Golang. It is a RESTful API that allows you to perform CRUD operations on a book resource.
This project is for the sake of learning.
- Create a book
- Get all books
- Get a single book
- Update a book
- Delete a book
To get started with this project, you need to have Golang installed on your local machine. You can download and install Golang from here.
# Clone the repository
git clone https://github.com/taham8875/book-api
# Change into the project directory
cd book-api
# Install dependencies from the go.mod file
go mod download
# Run the application
go run main.go
You may use a REST client like Postman to test the API endpoints.
ret.mp4
Endpoint | Method | Description |
---|---|---|
/api/books |
GET |
Get all books |
/api/books/{id} |
GET |
Get a single book |
/api/books |
POST |
Create a book |
/api/books/{id} |
PUT |
Update a book |
/api/books/{id} |
DELETE |
Delete a book |