From 774ca114dd150237bf20b69a06210b1fa90a3492 Mon Sep 17 00:00:00 2001 From: stuzer05 Date: Wed, 27 Mar 2024 22:36:10 +0200 Subject: [PATCH] Refactor --- .env.example | 2 ++ main.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index d4fac2b..cea702d 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,7 @@ CONFIG_PATH=/opt/bin/monobank-firefly3-bot/config.json +LISTEN=:8080 + FIREFLY3_API_URL=https://firefly3.stuzer.link/api FIREFLY3_TOKEN= diff --git a/main.go b/main.go index 436b337..651d685 100644 --- a/main.go +++ b/main.go @@ -33,8 +33,8 @@ func main() { http.HandleFunc("/webhook", handleWebhook) // listen server - fmt.Println("Webhook server listening on :3021") // @todo make env - err = http.ListenAndServe(":3021", nil) + fmt.Println("Webhook server listening on " + os.Getenv("LISTEN")) + err = http.ListenAndServe(os.Getenv("LISTEN"), nil) if err != nil { panic(err.Error()) }