package config import ( "os" "github.com/joho/godotenv" ) type Config struct { Port string DBHost string DBPort string DBUser string DBPass string DBName string JWTSecret string AllowedOrigins string CookieSecure bool } func Load() *Config { _ = godotenv.Load() return &Config{ Port: getEnv("PORT", "8080"), DBHost: getEnv("DB_HOST", "localhost"), DBPort: getEnv("DB_PORT", "5432"), DBUser: getEnv("DB_USER", "partymix"), DBPass: getEnv("DB_PASSWORD", "partymix"), DBName: getEnv("DB_NAME", "partymix"), JWTSecret: getEnv("JWT_SECRET", "change-me-in-production"), AllowedOrigins: getEnv("ALLOWED_ORIGINS", "http://localhost:3001,http://localhost:3000"), CookieSecure: getEnv("COOKIE_SECURE", "false") == "true", } } func getEnv(key, fallback string) string { if v := os.Getenv(key); v != "" { return v } return fallback }