package config import ( "os" ) type Config struct { FREDAPIKey string ServerPort string FREDBaseURL string } func Load() *Config { apiKey := os.Getenv("FRED_API_KEY") if apiKey == "" { apiKey = "987b9c3428a3d0fe90179e3e6298d05e" } port := os.Getenv("SERVER_PORT") if port == "" { port = "8080" } baseURL := os.Getenv("FRED_BASE_URL") if baseURL == "" { baseURL = "https://api.stlouisfed.org/fred" } return &Config{ FREDAPIKey: apiKey, ServerPort: port, FREDBaseURL: baseURL, } }