This repository contains a RESTful API built using the Gin framework and GORM for database operations.
- CRUD operations
- Database interaction with GORM
- RESTful API structure
- Go 1.15 or higher
- A running PostgreSQL database
-
Clone the repository:
git clone https://github.com/muthukumar89uk/gin-RESTAPI-postgres-gorm.git
Click here to directly download it.
go mod tidy
-
Run the Server
go run .
-
The server will start on
http://localhost:8080
.
POST /user
- Create a new userGET /users
- Retrieve all userGET /user/:id
- Retrieve an user by IDPUT /user/:id
- Update an existing userDELETE /user/:id
- Delete an user