Merge pull request #3 from Canecat/bugfix/oauth2RedirectUrl-param-added
updated examples
This commit is contained in:
commit
3aaadaa9d6
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue