Merge pull request #3 from Canecat/bugfix/oauth2RedirectUrl-param-added

updated examples
This commit is contained in:
Canecat 2019-11-27 17:50:04 +02:00 committed by GitHub
commit 3aaadaa9d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View File

@ -2,8 +2,8 @@ package main
import (
"github.com/gin-gonic/gin"
"github.com/swaggo/files"
"github.com/swaggo/gin-swagger"
swaggerFiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"
_ "github.com/swaggo/gin-swagger/example/basic/docs"
)
@ -25,8 +25,9 @@ import (
func main() {
r := gin.New()
url := ginSwagger.URL("http://localhost:8080/swagger/doc.json") // The url pointing to API definition
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, url))
swaggerBase := ginSwagger.SwaggerBase("swagger/")
specFileName := ginSwagger.SpecFileName("doc.json")
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, swaggerBase, specFileName))
r.Run()
}

View File

@ -3,8 +3,8 @@ package main
import (
"github.com/gin-contrib/gzip"
"github.com/gin-gonic/gin"
"github.com/swaggo/files"
"github.com/swaggo/gin-swagger"
swaggerFiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"
_ "github.com/swaggo/gin-swagger/example/basic/docs"
)
@ -28,8 +28,9 @@ func main() {
r.Use(gzip.Gzip(gzip.BestSpeed))
url := ginSwagger.URL("http://localhost:8080/swagger/doc.json") // The url pointing to API definition
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, url))
swaggerBase := ginSwagger.SwaggerBase("swagger/")
specFileName := ginSwagger.SpecFileName("doc.json")
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, swaggerBase, specFileName))
r.Run()
}