Allow to disable swagger (#2093)

https://github.com/woodpecker-ci/woodpecker/issues/1944
This commit is contained in:
qwerty287
2023-08-03 02:42:30 +02:00
committed by GitHub
parent f06e0acdc6
commit 1a7f7a9427
9 changed files with 40 additions and 9 deletions

View File

@@ -69,7 +69,9 @@ func Load(noRouteHandler http.HandlerFunc, middleware ...gin.HandlerFunc) http.H
e.GET("/healthz", api.Health)
apiRoutes(e)
setupSwaggerConfigAndRoutes(e)
if server.Config.Server.EnableSwagger {
setupSwaggerConfigAndRoutes(e)
}
return e
}