From f3a447cb68f458bf369b8230a558f529a17d6bfc Mon Sep 17 00:00:00 2001 From: Hamcha Date: Thu, 30 Jan 2020 12:39:45 +0100 Subject: [PATCH] Set default bind --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index d954f17..0f0be45 100644 --- a/main.go +++ b/main.go @@ -22,6 +22,10 @@ var MaxRequestsPerMessage int func main() { MaxRequestsPerMessage, _ = strconv.Atoi(os.Getenv("STAPPA_MAXREQ")) + bind := os.Getenv("STAPPA_BIND") + if bind == "" { + bind = ":8080" + } // Set default maxreq if MaxRequestsPerMessage < 1 { @@ -30,7 +34,7 @@ func main() { api = tg.MakeAPIClient(os.Getenv("STAPPA_TOKEN")) api.SetWebhook(os.Getenv("STAPPA_WEBHOOK")) - api.HandleWebhook(os.Getenv("STAPPA_BIND"), os.Getenv("STAPPA_PATH"), webhook) + api.HandleWebhook(bind, os.Getenv("STAPPA_PATH"), webhook) } type CardFaceFlipPics struct {