From 4a72d24cdd0749738330d11564deed97377ec92b Mon Sep 17 00:00:00 2001 From: Nicholas Thompson Date: Fri, 22 Mar 2019 15:25:13 +0200 Subject: [PATCH] Plugin grouping to make reading the code easier --- cmd/invertergui/main.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cmd/invertergui/main.go b/cmd/invertergui/main.go index 3c48803..100576f 100644 --- a/cmd/invertergui/main.go +++ b/cmd/invertergui/main.go @@ -66,15 +66,20 @@ func main() { cli.NewCli(core.NewSubscription()) } + // Webgui gui := webui.NewWebGui(core.NewSubscription()) - mu := munin.NewMunin(core.NewSubscription()) - prometheus.NewPrometheus(core.NewSubscription()) - http.Handle("/", static.New()) http.Handle("/ws", http.HandlerFunc(gui.ServeHub)) + + // Munin + mu := munin.NewMunin(core.NewSubscription()) http.Handle("/munin", http.HandlerFunc(mu.ServeMuninHTTP)) http.Handle("/muninconfig", http.HandlerFunc(mu.ServeMuninConfigHTTP)) + + // Prometheus + prometheus.NewPrometheus(core.NewSubscription()) http.Handle("/metrics", promhttp.Handler()) + log.Fatal(http.ListenAndServe(*addr, nil)) }