feat: initial FRED API Proxy project

- Go web server using Gin framework
- Proxy FRED economic data API
- Support series, observations, search, releases endpoints
This commit is contained in:
2026-04-01 06:48:29 +00:00
commit 96711ffb35
10 changed files with 755 additions and 0 deletions

34
config/config.go Normal file
View File

@@ -0,0 +1,34 @@
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,
}
}