Added frontend
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user