mirror of
https://github.com/aljazceru/signal-cli-rest-api.git
synced 2025-12-19 07:34:23 +01:00
add possibility to specify HTTPS as default scheme in the swagger UI
see #639
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user