fix working example/basic/api function (#123)
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"github.com/swaggo/files"
|
||||
"github.com/swaggo/gin-swagger"
|
||||
|
||||
"github.com/swaggo/gin-swagger/example/basic/api"
|
||||
|
||||
_ "github.com/swaggo/gin-swagger/example/basic/docs"
|
||||
)
|
||||
|
||||
@@ -20,12 +22,15 @@ import (
|
||||
// @license.name Apache 2.0
|
||||
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
// @host petstore.swagger.io
|
||||
// @host petstore.swagger.io:8080
|
||||
// @BasePath /v2
|
||||
func main() {
|
||||
r := gin.New()
|
||||
|
||||
url := ginSwagger.URL("http://localhost:8080/swagger/doc.json") // The url pointing to API definition
|
||||
r.GET("/v2/testapi/get-string-by-int/:some_id", api.GetStringByInt)
|
||||
r.GET("/v2/testapi/get-struct-array-by-string/:some_id", api.GetStructArrayByString)
|
||||
|
||||
url := ginSwagger.URL("http://petstore.swagger.io:8080/swagger/doc.json") // The url pointing to API definition
|
||||
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, url))
|
||||
|
||||
r.Run()
|
||||
|
||||
Reference in New Issue
Block a user