akshaykhanna / GolangGinAPI

Golang Gin Rest API with Swagger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Golang Gin Rest API with Swagger

Download gin

go get github.com/gin-gonic/gin

Run APi

go run main.go

API link

Get all users: http://localhost:8080/api/v1/users

Get user by id: http://localhost:8080/api/v1/users/:id

Download swagger

go get -u github.com/swaggo/swag/cmd/swag

Swagger link

http://localhost:8080/swagger/index.html

Generate/Init Swagger

swag init

Gin reference

https://medium.com/@etiennerouzeaud/how-to-create-a-basic-restful-api-in-go-c8e032ba3181

Swagger reference

https://github.com/swaggo/swag

About

Golang Gin Rest API with Swagger


Languages

Language:Go 100.0%