Initial updates server repository commit.
Reinitialize repository history and exclude generated OTA artifact outputs. Made-with: Cursor
This commit is contained in:
22
internal/app/config.go
Normal file
22
internal/app/config.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package app
|
||||
|
||||
import "os"
|
||||
|
||||
func LoadConfig() Config {
|
||||
return Config{
|
||||
Port: envOrDefault("PORT", "3001"),
|
||||
Hostname: envOrDefault("HOSTNAME", "http://localhost:3001"),
|
||||
UpdatesRoot: envOrDefault("UPDATES_ROOT", "updates"),
|
||||
PrivateKey: os.Getenv("PRIVATE_KEY_PATH"),
|
||||
AdminToken: os.Getenv("ADMIN_TOKEN"),
|
||||
}
|
||||
}
|
||||
|
||||
func envOrDefault(key string, fallback string) string {
|
||||
v := os.Getenv(key)
|
||||
if v == "" {
|
||||
return fallback
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user