Improve landing page
authorBrian Brazil <brian.brazil@robustperception.io>
Sun, 6 Sep 2015 06:40:09 +0000 (07:40 +0100)
committerBrian Brazil <brian.brazil@robustperception.io>
Sun, 6 Sep 2015 06:40:09 +0000 (07:40 +0100)
main.go

diff --git a/main.go b/main.go
index 8bdb5292e45050d3ddaeca0a8021aa4958eb953c..d3889ab78c05051a88572381821a694a60207ae8 100644 (file)
--- a/main.go
+++ b/main.go
@@ -99,5 +99,17 @@ func main() {
                func(w http.ResponseWriter, r *http.Request) {
                        probeHandler(w, r, &config)
                })
-       http.ListenAndServe(*addr, nil)
+       http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
+               w.Write([]byte(`<html>
+            <head><title>Blackbox Exporter</title></head>
+            <body>
+            <h1>Blackbox Exporter</h1>
+            <p><a href="/probe?target=prometheus.io&module=http2xx">Probe prometheus.io for http2xx</a></p>
+            <p><a href="/metrics">Metrics</a></p>
+            </body>
+            </html>`))
+       })
+       if err := http.ListenAndServe(*addr, nil); err != nil {
+               log.Fatalf("Error starting HTTP server: %s", err)
+       }
 }