From fdba7a7ecd83361aaffe0348142b991c201e929e Mon Sep 17 00:00:00 2001 From: "Stephen McQuay (smcquay)" Date: Wed, 7 Feb 2018 13:58:15 -0800 Subject: [PATCH] Adds liveness and readiness --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 8516f29..dc0e2a9 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,7 @@ import ( "os" ) -const version = "v0.0.7" +const version = "v0.0.8" type v struct { Hostname string `json:"hostname"` @@ -35,7 +35,11 @@ func main() { fmt.Fprintf(w, "%v\n", line) } }) + http.HandleFunc("/live", health) + http.HandleFunc("/ready", health) if err := http.ListenAndServe(":8080", nil); err != nil { log.Fatalf("listen and serve: %v", err) } } + +func health(w http.ResponseWriter, req *http.Request) {}