From 817e36b1688066cdb1ded74c120aa463dbd583c8 Mon Sep 17 00:00:00 2001 From: okseby Date: Mon, 28 Aug 2023 23:34:42 -0400 Subject: [PATCH] Move port to a env variable --- bot/utils.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bot/utils.go b/bot/utils.go index 342120f..78f68ba 100644 --- a/bot/utils.go +++ b/bot/utils.go @@ -14,6 +14,7 @@ import ( // Wrap the shared transport for use with the integration ID and authenticating with installation ID. var privateKey = os.Getenv("privateKey") +var port = os.Getenv("port") var itr, _ = ghinstallation.New(http.DefaultTransport, 381312, 41105280, []byte(privateKey)) // Use installation transport with client. @@ -32,12 +33,12 @@ func initGitHubClient() { } func listenForWebhook() { - log.Println("Listening on :433......") + log.Printf("Listening on :%d......\n", port) http.HandleFunc("/", webHandle) http.HandleFunc("/webhook", webhookHandler) - err := http.ListenAndServe(":433", nil) + err := http.ListenAndServe(port, nil) if err != nil { panic(err) }