Skip to content

REST API using Golang, Gin, JWT Authentication connected to MongoDB

Notifications You must be signed in to change notification settings

rahulsai1999/go-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang REST API

Build Status

  • Available on Postman Docs
  • Basic REST API built on Golang using the Gin-Gonic Framework
  • Connected to MongoDB
  • Uses Go Modules
  • Implements basic CRUD operations (for now)
  • Implements Authentication from scratch using Bcrypt and JWT

To run

Direct (Golang installed)

  • Clone repository
  • Fill out .env file as given in env.example
  • Run the main.go file
git clone https://github.com/rahulsai1999/go-rest.git
cd go-rest
go get -u
go run ./main.go

Using Docker

docker pull noneuser2183/go-rest
docker run -p 5000:5000 noneuser2183/go-rest

(or)

  • Clone the Repository
  • Fill out the .env file
  • Build the Docker image
git clone https://github.com/rahulsai1999/go-rest.git
cd go-rest
docker build -t go-rest .
docker run -p 5000:5000 go-rest

API

Type of Request Route Handler Package
GET / github.com/rahulsai1999/go-rest/service.ExtRouter
GET /ping github.com/rahulsai1999/go-rest/service/api.Ping
GET /blog github.com/rahulsai1999/go-rest/service/api.GetAllBlogs
GET /blog/:id github.com/rahulsai1999/go-rest/service/api.GetBlogs
POST /blog github.com/rahulsai1999/go-rest/service/api.InsertBlog
PUT /blog/:id github.com/rahulsai1999/go-rest/service/api.UpdateBlog
DELETE /blog/:id github.com/rahulsai1999/go-rest/service/api.DeleteBlog

About

REST API using Golang, Gin, JWT Authentication connected to MongoDB

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published