add root endpoint with redirect

This commit is contained in:
Mac Browning 2015-10-09 20:26:05 -04:00
parent 4270a5ed7e
commit c4ab11d05c

View file

@ -34,6 +34,15 @@ var (
func serveHTTP() {
http.Handle(*metricsEndpoint, prometheus.Handler())
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`<html>
<head><title>StatsD Bridge</title></head>
<body>
<h1>StatsD Bridge</h1>
<p><a href="` + *metricsEndpoint + `">Metrics</a></p>
</body>
</html>`))
})
http.ListenAndServe(*listenAddress, nil)
}