feat(WrapHandler): add config using functional options (#52)

* feat(WrapHandler): add config using functional options

* refine comment
This commit is contained in:
Eason Lin
2019-03-29 09:46:37 +08:00
committed by pei
parent f9b4e464b0
commit 9668210ca1
2 changed files with 17 additions and 8 deletions
+2 -4
View File
@@ -25,10 +25,8 @@ import (
func main() {
r := gin.New()
config := &ginSwagger.Config{
URL: "http://localhost:8080/swagger/doc.json", //The url pointing to API definition
}
r.GET("/swagger/*any", ginSwagger.CustomWrapHandler(config, swaggerFiles.Handler))
url := ginSwagger.URL("http://localhost:8080/swagger/doc.json") //The url pointing to API definition
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, url))
r.Run()
}