Skip to content

ckukadiya/go-gin-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GO-Gin-Boilerplate

This boilerplate is build with traditional web applications and microservices in Go using the Gin framework with MongoDB as a database.

Gin is a framework that reduces boilerplate code that would normally go into building these applications. It also lends itself very well to creating reusable and extensible pieces of code.

This boilerplate will help you to set up your projects with following prerequisites while developing the rest API.

  • Environments config
  • Logger
  • Auto-reload while changing the code with Air
  • Database connection
  • Swagger

Installation

Prerequisites:

You will need the following prerequisites installed on your machine.

  1. Go (Setup Go Enviourment)
  2. MongoDB (Setup MongoDB Enviourment)
Install Dependencies

Install all Go.mod dependencies

go list -m all

Install Swagger

go get github.com/go-swagger/go-swagger/cmd/swagger

Install Air

go get -u github.com/cosmtrek/air

RUN

Run the application just write following command

air
For Production Mode

Create the following environment variable

APP_MODE = prod

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published