https://github.com/muthukumar89uk/gin-restapi-postgres-gorm
Simple RESTful CRUD demo code using @golang , @gin-gonic web framework @go-gorm ORM driver & @postgres DB
https://github.com/muthukumar89uk/gin-restapi-postgres-gorm
gin-framework golang gorm postgresql rest-api
Last synced: about 2 months ago
JSON representation
Simple RESTful CRUD demo code using @golang , @gin-gonic web framework @go-gorm ORM driver & @postgres DB
- Host: GitHub
- URL: https://github.com/muthukumar89uk/gin-restapi-postgres-gorm
- Owner: muthukumar89uk
- Created: 2024-07-25T06:25:34.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-07-31T13:17:29.000Z (10 months ago)
- Last Synced: 2025-02-08T01:33:22.633Z (3 months ago)
- Topics: gin-framework, golang, gorm, postgresql, rest-api
- Language: Go
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gin GORM REST APIs
This repository contains a RESTful API built using the Gin framework and GORM for database operations.
## Features
- CRUD operations
- Database interaction with GORM
- RESTful API structure## Requirements
- Go 1.15 or higher
- A running PostgreSQL database## Getting Started
## Installation
1. Clone the repository:
```
git clone https://github.com/muthukumar89uk/gin-RESTAPI-postgres-gorm.git
```
Click here to directly [download it](https://github.com/muthukumar89uk/gin-RESTAPI-postgres-gorm/zipball/master).## Install dependencies:
go mod tidy
## Run the Application
1. Run the Server
```
go run .
```
2. The server will start on `http://localhost:8080`.## API Endpoints
- `POST /user` - Create a new user
- `GET /users` - Retrieve all user
- `GET /user/:id` - Retrieve an user by ID
- `PUT /user/:id` - Update an existing user
- `DELETE /user/:id`- Delete an user## Refer
- [Gin Web Framework](https://github.com/gin-gonic/gin)
- [GORM](https://gorm.io/)