diff --git a/backend/.env.example b/backend/.env.example index 6589599..6aa94f2 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -31,7 +31,7 @@ CORS_ORIGINS=* # Swagger Configuration # Host without scheme (ex: localhost:8214 or api.saveinmed.com) -SWAGGER_HOST=localhost:8214 +BACKEND_HOST=localhost:8214 # Comma-separated list of schemes shown in Swagger UI selector SWAGGER_SCHEMES=http,https diff --git a/backend/cmd/api/main.go b/backend/cmd/api/main.go index 0e7f11f..c4f16bf 100644 --- a/backend/cmd/api/main.go +++ b/backend/cmd/api/main.go @@ -30,8 +30,8 @@ func main() { // swagger metadata overrides docs.SwaggerInfo.Title = cfg.AppName docs.SwaggerInfo.BasePath = "/" - if cfg.SwaggerHost != "" { - docs.SwaggerInfo.Host = cfg.SwaggerHost + if cfg.BackendHost != "" { + docs.SwaggerInfo.Host = cfg.BackendHost } if len(cfg.SwaggerSchemes) > 0 { docs.SwaggerInfo.Schemes = cfg.SwaggerSchemes diff --git a/backend/internal/config/config.go b/backend/internal/config/config.go index c77a0d5..befc415 100644 --- a/backend/internal/config/config.go +++ b/backend/internal/config/config.go @@ -22,7 +22,7 @@ type Config struct { JWTExpiresIn time.Duration PasswordPepper string CORSOrigins []string - SwaggerHost string + BackendHost string SwaggerSchemes []string } @@ -42,7 +42,7 @@ func Load() Config { JWTExpiresIn: getEnvDuration("JWT_EXPIRES_IN", 24*time.Hour), PasswordPepper: getEnv("PASSWORD_PEPPER", ""), CORSOrigins: getEnvStringSlice("CORS_ORIGINS", []string{"*"}), - SwaggerHost: getEnv("SWAGGER_HOST", ""), + BackendHost: getEnv("BACKEND_HOST", ""), SwaggerSchemes: getEnvStringSlice("SWAGGER_SCHEMES", []string{"http"}), }