Added frontend

This commit is contained in:
2026-04-03 11:51:36 +02:00
parent 12678f8241
commit 29ee01afba
30 changed files with 1 additions and 337 deletions
+48
View File
@@ -0,0 +1,48 @@
package envconfig
import (
"os"
)
type EnvConfig struct {
Port string
ConfigDir string
GithubPat string
StoragePath string
DashboardHost string
}
func Load() EnvConfig {
port := os.Getenv("PORT")
if port == "" {
port = "4321"
}
configDir := os.Getenv("CONFIG_DIR")
if configDir == "" {
configDir = "./"
}
githubPat := os.Getenv("GITHUB_PAT")
if githubPat == "" {
githubPat = ""
}
storagePath := os.Getenv("STORAGE_PATH")
if storagePath == "" {
storagePath = "./storage"
}
dashboardHost := os.Getenv("DASHBOARD_HOST")
if dashboardHost == "" {
dashboardHost = "localhost"
}
return EnvConfig{
Port: port,
ConfigDir: configDir,
GithubPat: githubPat,
StoragePath: storagePath,
DashboardHost: dashboardHost,
}
}