Merge pull request #25 from rowbawts/dev

Move webhook endpoint
This commit is contained in:
Sebastian Cabrera 2023-08-28 20:32:03 -04:00 committed by GitHub
commit c39326c6b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 {