Skip to content

muthukumar89uk/gin-RESTAPI-postgres-gorm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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

About

Simple RESTful CRUD demo code using @golang , @gin-gonic web framework @go-gorm ORM driver & @postgres DB

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages