Adds liveness and readiness

This commit is contained in:
Stephen McQuay 2018-02-07 13:58:15 -08:00
parent 54ced08b5a
commit fdba7a7ecd
Signed by: sm
GPG Key ID: 4E4B72F479BA3CE5
1 changed files with 5 additions and 1 deletions

View File

@ -8,7 +8,7 @@ import (
"os" "os"
) )
const version = "v0.0.7" const version = "v0.0.8"
type v struct { type v struct {
Hostname string `json:"hostname"` Hostname string `json:"hostname"`
@ -35,7 +35,11 @@ func main() {
fmt.Fprintf(w, "%v\n", line) fmt.Fprintf(w, "%v\n", line)
} }
}) })
http.HandleFunc("/live", health)
http.HandleFunc("/ready", health)
if err := http.ListenAndServe(":8080", nil); err != nil { if err := http.ListenAndServe(":8080", nil); err != nil {
log.Fatalf("listen and serve: %v", err) log.Fatalf("listen and serve: %v", err)
} }
} }
func health(w http.ResponseWriter, req *http.Request) {}