A simple RESTful API for managing a bookstore, built with Gin and GORM using SQLite.
- Go installed (version 1.16 or higher)
1. Clone the repository:
git clone https://github.com/askmhs/gin-book-store.git
cd gin-book-store2. Install dependencies:
go get .3. Set up ENV config:
cp .env.example .envUpdate the ENV variables value
4. Run the application:
go run main.goThe server will start on http://localhost:8080.
POST /users/register- Register a new userPOST /useres/login- Login userGET /books- Retrieve all booksGET /books/:id- Retrieve a book by IDPOST /books- Create a new bookPUT /books/:id- Update an existing bookDELETE /books/:id- Delete a book
This project is licensed under the MIT License.