Skip to content

Commit

Permalink
adding /healthz endpoint (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Sheldon authored Jan 3, 2020
1 parent 7c25f57 commit 7162167
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package main

import (
"io"
"net/http"

"github.com/drone/drone-go/plugin/converter"
Expand Down Expand Up @@ -61,5 +62,11 @@ func main() {
logrus.Infof("server listening on address %s", spec.Bind)

http.Handle("/", handler)
http.HandleFunc("/healthz", healthz)
logrus.Fatal(http.ListenAndServe(spec.Bind, nil))
}

func healthz(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain")
io.WriteString(w, "OK")
}

0 comments on commit 7162167

Please sign in to comment.