Added api host guard

This commit is contained in:
2026-04-03 10:31:19 +02:00
parent 1aba69cfb5
commit a2e5c735a6
3 changed files with 32 additions and 6 deletions
+11 -5
View File
@@ -5,11 +5,11 @@ import (
)
type EnvConfig struct {
Port string
ConfigDir string
GithubPat string
StoragePath string
DatabasePath string
Port string
ConfigDir string
GithubPat string
StoragePath string
ApiHost string
}
func Load() EnvConfig {
@@ -33,10 +33,16 @@ func Load() EnvConfig {
storagePath = "./storage"
}
apiHost := os.Getenv("API_HOST")
if apiHost == "" {
apiHost = "localhost"
}
return EnvConfig{
Port: port,
ConfigDir: configDir,
GithubPat: githubPat,
StoragePath: storagePath,
ApiHost: apiHost,
}
}