Spaces:
Paused
Paused
ML Intern deploy
Deploy httpSMS gateway to Hugging Face Spaces (Docker SDK): nginx :7860 -> Go API :8000, Nuxt SPA, Android APK, bootstrap-mode entrypoint
83a59ca Download api/pkg/di/config.go from red-kit/httpsms-gateway: direct link, hf CLI and curl.
- Browser
- Download file 777 Bytes
-
https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/api/pkg/di/config.go
- Command line
-
hf download hf://spaces/red-kit/httpsms-gateway/api/pkg/di/config.go
-
curl -L -o config.go https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/api/pkg/di/config.go
777 Bytes
| package di | |
| import ( | |
| "log" | |
| "os" | |
| "strings" | |
| "github.com/joho/godotenv" | |
| ) | |
| // LoadEnv will read your .env file(s) and load them into ENV for this process. | |
| func LoadEnv(filenames ...string) { | |
| err := godotenv.Load(filenames...) | |
| if err != nil { | |
| log.Fatalf("Fatal: cannot load .env file: %v", err) | |
| } | |
| } | |
| func getEnvWithDefault(key, defaultValue string) string { | |
| value := os.Getenv(key) | |
| if value == "" { | |
| return defaultValue | |
| } | |
| return value | |
| } | |
| func splitCommaEnv(key, defaultValue string) []string { | |
| value := getEnvWithDefault(key, defaultValue) | |
| parts := strings.Split(value, ",") | |
| result := make([]string, 0, len(parts)) | |
| for _, part := range parts { | |
| if trimmed := strings.TrimSpace(part); trimmed != "" { | |
| result = append(result, trimmed) | |
| } | |
| } | |
| return result | |
| } | |