mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-01-26 19:03:33 +00:00
add possibility to specify HTTPS as default scheme in the swagger UI
see #639
This commit is contained in:
parent
3752538e9b
commit
3914178ec7
@ -138,4 +138,6 @@ There are a bunch of environmental variables that can be set inside the docker c
|
||||
|
||||
* `SWAGGER_IP`: The IP that's used in the Swagger UI for the interactive examples. Defaults to the container ip.
|
||||
|
||||
* `SWAGGER_USE_HTTPS_AS_PREFERRED_SCHEME`: Use the HTTPS Scheme as preferred scheme in the Swagger UI.
|
||||
|
||||
* `PORT`: Defaults to port `8080` unless this env var is set to tell it otherwise.
|
||||
|
||||
@ -77,7 +77,11 @@ func main() {
|
||||
avatarTmpDir := flag.String("avatar-tmp-dir", "/tmp/", "Avatar tmp directory")
|
||||
flag.Parse()
|
||||
|
||||
docs.SwaggerInfo.Schemes = []string{"http", "https"}
|
||||
if utils.GetEnv("SWAGGER_USE_HTTPS_AS_PREFERRED_SCHEME", "false") == "false" {
|
||||
docs.SwaggerInfo.Schemes = []string{"http", "https"}
|
||||
} else {
|
||||
docs.SwaggerInfo.Schemes = []string{"https", "http"}
|
||||
}
|
||||
|
||||
router := gin.New()
|
||||
router.Use(gin.LoggerWithConfig(gin.LoggerConfig{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user