From d7eba0a5d654e06c75210252e28e017ab2a59ed1 Mon Sep 17 00:00:00 2001 From: Muyao CHEN Date: Wed, 2 Oct 2024 22:58:20 +0200 Subject: [PATCH] feat: set addr from config --- configs/howmuch.yml | 2 ++ internal/howmuch/howmuch.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configs/howmuch.yml b/configs/howmuch.yml index 950db14..ab34c0a 100644 --- a/configs/howmuch.yml +++ b/configs/howmuch.yml @@ -20,6 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +addr: :8080 + db: # DB host host: 127.0.0.1 diff --git a/internal/howmuch/howmuch.go b/internal/howmuch/howmuch.go index 2cade80..afdcb7e 100644 --- a/internal/howmuch/howmuch.go +++ b/internal/howmuch/howmuch.go @@ -110,7 +110,7 @@ func run() error { }) }) - r.Run(":8080") + r.Run(viper.GetString("addr")) return nil }