kg: add new handler for rendering the topology graph

This commit is contained in:
Steffen Vogel
2021-07-15 17:54:21 +02:00
parent abecadf707
commit 0de2a988cc
3 changed files with 121 additions and 4 deletions

View File

@@ -196,9 +196,8 @@ func Main() error {
{
// Run the HTTP server.
mux := http.NewServeMux()
mux.HandleFunc("/health", func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
})
mux.Handle("/health", &HealthHandler{})
mux.Handle("/graph", &GraphHandler{m, gr})
mux.Handle("/metrics", promhttp.HandlerFor(r, promhttp.HandlerOpts{}))
l, err := net.Listen("tcp", *listen)
if err != nil {