File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # ** Gin GORM REST APIs**
1+ # Gin GORM REST APIs
22
3- Clone the git repo - ` git clone https://github.com/muthukumar89uk/gin-RESTAPI-postgres-gorm.git ` - or [ download it] ( https://github.com/muthukumar89uk/gin-RESTAPI-postgres-gorm/zipball/master ) .
3+ This repository contains a RESTful API built using the Gin framework and GORM for database operations.
4+
5+ ## Features
6+
7+ - CRUD operations
8+ - Database interaction with GORM
9+ - RESTful API structure
10+
11+ ## Requirements
12+
13+ - Go 1.15 or higher
14+ - A running PostgreSQL database
15+
16+ ## Getting Started
17+
18+ ## Installation
19+
20+ 1 . Clone the repository:
21+
22+ ``` sh
23+ git clone https://github.com/yourusername/gin-gorm-rest-api.git
24+ cd gin-gorm-rest-api
25+ Click here to directly [download it](https://github.com/muthukumar89uk/go-chatapp-websocket/zipball/master).
26+
27+ # # Install dependencies:
28+
29+ go mod tidy
30+
31+ # # Run the Application
32+ 1. Run the Server
33+
34+ ```
35+ go run .
36+ 2. The server will start on ` http://localhost:8080` .
37+
38+ # # API Endpoints
39+
40+ - ` POST /user` - Create a new user
41+ - ` GET /users` - Retrieve all user
42+ - ` GET /user/:id` - Retrieve an user by ID
43+ - ` PUT /user/:id` - Update an existing user
44+ - ` DELETE /user/:id` - Delete an user
45+
46+ # # Refer
47+ - [Gin Web Framework](https://github.com/gin-gonic/gin)
48+ - [GORM](https://gorm.io/)
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ func SetupRouter() *gin.Engine {
1212
1313 grp1 := r .Group ("/user-api" )
1414 {
15- grp1 .GET ("user " , controllers .GetUsers )
15+ grp1 .GET ("users " , controllers .GetUsers )
1616 grp1 .POST ("user" , controllers .CreateUser )
1717 grp1 .GET ("user/:id" , controllers .GetUserByID )
1818 grp1 .PUT ("user/:id" , controllers .UpdateUser )
You can’t perform that action at this time.
0 commit comments