forked from mirrors/statsd_exporter
Merge pull request #25 from macb/root_endpoint
add root endpoint with redirect
This commit is contained in:
commit
3bf0889452
1 changed files with 9 additions and 0 deletions
9
main.go
9
main.go
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue