Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmd/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ func main() {
log.Panicf("failed to register root GET handler: %v", err)
}

if err := d.MUX.HandlePath(http.MethodGet, "/healthcheck", func(w http.ResponseWriter, r *http.Request, _ map[string]string) {
w.WriteHeader(http.StatusOK)
}); err != nil {
log.Panicf("failed to register healthcheck GET handler: %v", err)
}

if err := d.ListenAndServe(ctx); err != nil {
log.Panicf("ListenAndServe() = %v", err)
}
Expand Down
3 changes: 3 additions & 0 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ func main() {
WebhookSecret: webhookSecrets,
Organizations: orgs,
})
mux.HandleFunc("/healthcheck", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
})
srv := &http.Server{
Addr: fmt.Sprintf(":%d", baseCfg.Port),
ReadHeaderTimeout: 10 * time.Second,
Expand Down