feat: support swagger configuration (#46)

This commit is contained in:
Eason Lin
2019-03-23 17:04:42 +08:00
committed by GitHub
parent ea4ea9de0c
commit 814845170e
4 changed files with 32 additions and 21 deletions
+4 -1
View File
@@ -25,7 +25,10 @@ import (
func main() {
r := gin.New()
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
config := &ginSwagger.Config{
URL: "http://localhost:8080/swagger/doc.json", //The url pointing to API definition
}
r.GET("/swagger/*any", ginSwagger.WrapHandler(config, swaggerFiles.Handler))
r.Run()
}