FILE / Unmei/Backend

utils/env.go

Исходный файл и его история в репозитории.
FILE 45bb32e7a6664f9c680c83ff29b4ed1b934d7912
Files
Backend/utils/env.go
T
2025-03-12 16:30:40 +03:00

28 lines
413 B
Go

package utils
import (
"os"
)
func GetFrontendURL() string {
if IsDevelopment() {
return os.Getenv("DEV_FRONTEND_URL")
}
return os.Getenv("FRONTEND_URL")
}
func IsDevelopment() bool {
return os.Getenv("DEVELOPMENT") == "true"
}
func IsDebug() bool {
return os.Getenv("DEBUG") == "true"
}
func Getenv(key, def string) string {
value := os.Getenv(key)
if value == "" {
return def
}
return value
}