Fix printing of port to console from placeholder and change some formatting of logging

This commit is contained in:
Sebastian Cabrera 2023-08-28 23:41:09 -04:00
parent 817e36b168
commit 7eee357aad

View file

@ -27,13 +27,20 @@ func initGitHubClient() {
if privateKey != "" { if privateKey != "" {
log.Println("Private key loaded from env!") log.Println("Private key loaded from env!")
} else { } else {
log.Println("Private key not found!") log.Println("No private key specified in env!")
os.Exit(0)
}
if port != "" {
log.Println("Port configured from env!")
} else {
log.Println("No port specified in env!")
os.Exit(0) os.Exit(0)
} }
} }
func listenForWebhook() { func listenForWebhook() {
log.Printf("Listening on :%d......\n", port) log.Printf("Listening on :%s......\n", port)
http.HandleFunc("/", webHandle) http.HandleFunc("/", webHandle)
http.HandleFunc("/webhook", webhookHandler) http.HandleFunc("/webhook", webhookHandler)