This repository has been archived on 2026-01-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
cover-letter-templater/backend/config/config.go
2025-07-03 17:55:15 +03:00

21 lines
380 B
Go

package config
import "os"
func defaultValue(val string, def string) string {
if val == "" {
return def
}
return val
}
func LoadEnv() map[string]string {
// Create object where to store used variables
env := make(map[string]string, 1)
// Get env variables that will be used while server is running
env["port"] = defaultValue(os.Getenv("PORT"), "8080")
return env
}