From cd631cc01f72ec21814c546026ae2a15fccf387d Mon Sep 17 00:00:00 2001 From: okseby Date: Mon, 28 Aug 2023 20:31:46 -0400 Subject: [PATCH] Move webhook endpoint --- bot/utils.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bot/utils.go b/bot/utils.go index e01aff8..872231f 100644 --- a/bot/utils.go +++ b/bot/utils.go @@ -25,7 +25,8 @@ func initGitHubClient() { func listenForWebhook() { log.Println("Listening on :3333......") - http.HandleFunc("/", webhookHandler) + http.HandleFunc("/", new wr) + http.HandleFunc("/webhook", webhookHandler) err := http.ListenAndServe(":3333", nil) if err != nil { @@ -33,6 +34,10 @@ func listenForWebhook() { } } +func webHandle(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Turn back!") +} + func webhookHandler(w http.ResponseWriter, r *http.Request) { payload, err := github.ValidatePayload(r, nil) if err != nil {