book-shop api-gateway for template
- download swag by y using
go install github.com/swaggo/swag/cmd/swag@latest
go get -u github.com/swaggo/gin-swagger
go get -u github.com/swaggo/files
- Import following in your code:
import "github.com/swaggo/gin-swagger" // gin-swagger middleware
import "github.com/swaggo/files" // swagger embed files
- write code ex:
// @Router /v1/authors [post]
- generate:
swag init -g api/router.go -o api/docs