Skip to content

Commit

Permalink
fix: swagger doc
Browse files Browse the repository at this point in the history
  • Loading branch information
naiba committed Oct 24, 2024
1 parent eae12d8 commit fa9d023
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/dashboard/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ import (
swaggerfiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"

docs "github.com/naiba/nezha/cmd/dashboard/docs"
"github.com/naiba/nezha/model"
"github.com/naiba/nezha/service/singleton"
)

func ServeWeb() http.Handler {

gin.SetMode(gin.ReleaseMode)
r := gin.Default()

Expand All @@ -28,6 +30,7 @@ func ServeWeb() http.Handler {
pprof.Register(r)
}
if singleton.Conf.Debug {
log.Printf("NEZHA>> Swagger(%s) UI available at http://localhost:%d/swagger/index.html", docs.SwaggerInfo.Version, singleton.Conf.ListenPort)
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler))
}

Expand Down

0 comments on commit fa9d023

Please sign in to comment.