demo: Adding /liveness, /readiness, /startup paths to the bookstore web server
@@ -121,6 +121,9 @@ func getHandlers() []handler {
{"/books-bought", updateBooksSold, "POST"},
{"/buy-a-book/new", sellBook, "GET"},
{"/reset", reset, "GET"},
+ {"/liveness", ok, "GET"},
+ {"/readiness", ok, "GET"},
+ {"/startup", ok, "GET"},
}
}
@@ -129,6 +132,10 @@ func reset(w http.ResponseWriter, r *http.Request) {
renderTemplate(w)
}
+func ok(w http.ResponseWriter, r *http.Request) {
+ renderTemplate(w)
+}
+
func main() {
flag.Parse()
