Move webhook endpoint

This commit is contained in:
Sebastian Cabrera 2023-08-28 20:31:46 -04:00
parent 6c54a82295
commit cd631cc01f

View file

@ -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 {