Move webhook endpoint
This commit is contained in:
parent
6c54a82295
commit
cd631cc01f
1 changed files with 6 additions and 1 deletions
|
@ -25,7 +25,8 @@ func initGitHubClient() {
|
||||||
func listenForWebhook() {
|
func listenForWebhook() {
|
||||||
log.Println("Listening on :3333......")
|
log.Println("Listening on :3333......")
|
||||||
|
|
||||||
http.HandleFunc("/", webhookHandler)
|
http.HandleFunc("/", new wr)
|
||||||
|
http.HandleFunc("/webhook", webhookHandler)
|
||||||
|
|
||||||
err := http.ListenAndServe(":3333", nil)
|
err := http.ListenAndServe(":3333", nil)
|
||||||
if err != 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) {
|
func webhookHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
payload, err := github.ValidatePayload(r, nil)
|
payload, err := github.ValidatePayload(r, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue