Files
wb-mock/internal/config/config.go
2026-07-23 19:02:03 +03:00

23 lines
318 B
Go

package config
import "os"
type Config struct {
Port string
APIKey string
}
func Load() *Config {
return &Config{
Port: getEnv("PORT", "8080"),
APIKey: os.Getenv("WB_API_KEY"),
}
}
func getEnv(key, defaultVal string) string {
if val := os.Getenv(key); val != "" {
return val
}
return defaultVal
}