Set host and port defaults in config

This commit is contained in:
lash 2025-01-12 11:08:36 +00:00
parent eda9453e2c
commit 26a51bc95f
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -36,6 +36,11 @@ var (
CheckAliasURL string
)
const (
defaultHTTPHost string = "127.0.0.1"
defaultHTTPPort uint = 7123
)
func setBase() error {
var err error
@ -71,3 +76,11 @@ func LoadConfig() error {
CheckAliasURL, _ = url.JoinPath(dataURLBase, AliasPrefix)
return nil
}
func Host() string {
return env.GetEnv("HOST", defaultHTTPHost)
}
func Port() uint {
return env.GetEnvUint("PORT", defaultHTTPPort)
}