Explorar o código

Add /api/healthz endpoint

Svilen Markov hai 10 meses
pai
achega
9a36187333
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      internal/glance/glance.go

+ 3 - 0
internal/glance/glance.go

@@ -275,6 +275,9 @@ func (a *Application) Serve() error {
 
 	mux.HandleFunc("GET /api/pages/{page}/content/{$}", a.HandlePageContentRequest)
 	mux.HandleFunc("/api/widgets/{widget}/{path...}", a.HandleWidgetRequest)
+	mux.HandleFunc("GET /api/healthz", func(w http.ResponseWriter, _ *http.Request) {
+		w.WriteHeader(http.StatusOK)
+	})
 
 	mux.Handle(
 		fmt.Sprintf("GET /static/%s/{path...}", a.Config.Server.AssetsHash),