mirror of
https://github.com/aljazceru/signal-cli-rest-api.git
synced 2026-01-30 04:04:29 +01:00
fixed bug in swagger documentation
* use configured SWAGGER_HOST env variable when generating the URL for the swagger documentation file. see #683
This commit is contained in:
@@ -335,7 +335,12 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
swaggerUrl := ginSwagger.URL("http://" + swaggerIp + ":" + string(port) + "/swagger/doc.json")
|
||||
protocol := "http"
|
||||
if utils.GetEnv("SWAGGER_USE_HTTPS_AS_PREFERRED_SCHEME", "false") == "true" {
|
||||
protocol = "https"
|
||||
}
|
||||
|
||||
swaggerUrl := ginSwagger.URL(protocol + "://" + swaggerHost + "/swagger/doc.json")
|
||||
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, swaggerUrl))
|
||||
|
||||
autoReceiveSchedule := utils.GetEnv("AUTO_RECEIVE_SCHEDULE", "")
|
||||
|
||||
Reference in New Issue
Block a user