Skip to content

Commit

Permalink
Add healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusfcr committed Dec 13, 2024
1 parent cc15265 commit b939672
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/http/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ func (c *Check) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// RunAndServe implements the behavior needed by the sdk for a check runner to
// execute a check.
func (c *Check) RunAndServe() {
http.HandleFunc("/healthcheck", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.Write([]byte(`"OK"`))
})
http.HandleFunc("/run", c.ServeHTTP)
c.Logger.Info(fmt.Sprintf("Listening at %s", c.server.Addr))
go func() {
Expand Down

0 comments on commit b939672

Please sign in to comment.