From 26a51bc95f38370ee961cbcc998536bc1e6d09f8 Mon Sep 17 00:00:00 2001 From: lash Date: Sun, 12 Jan 2025 11:08:36 +0000 Subject: [PATCH] Set host and port defaults in config --- config/config.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config/config.go b/config/config.go index 6ebb5bc..82c7b5d 100644 --- a/config/config.go +++ b/config/config.go @@ -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) +}