Add api package
Change-Id: Ifcdd1f45c01e98b91c1edef3371332cb4a098e82
diff --git a/server/config/config.go b/server/config/config.go
index baceb04..1a39c6f 100644
--- a/server/config/config.go
+++ b/server/config/config.go
@@ -10,6 +10,7 @@
// Config represents the Staff MVP configuration
type Config struct {
+ Server ServerConfig `yaml:"server"`
OpenAI OpenAIConfig `yaml:"openai"`
GitHub GitHubConfig `yaml:"github"`
Gerrit GerritConfig `yaml:"gerrit"`
@@ -18,6 +19,10 @@
Git GitConfig `yaml:"git"`
}
+type ServerConfig struct {
+ ListenAddress string `yaml:"listen_address"`
+}
+
// OpenAIConfig represents OpenAI provider configuration
type OpenAIConfig struct {
APIKey string `yaml:"api_key"`
@@ -126,6 +131,10 @@
config.Gerrit.Project = gerritProject
}
+ if listenAddr := os.Getenv("LISTEN_ADDRESS"); listenAddr != "" {
+ config.Server.ListenAddress = listenAddr
+ }
+
// Re-validate after env overrides
if err := validateConfig(*config); err != nil {
return nil, fmt.Errorf("invalid configuration after env overrides: %w", err)