Skip to content

Commit

Permalink
serve index page instead of 404
Browse files Browse the repository at this point in the history
  • Loading branch information
0x46616c6b committed Apr 28, 2016
1 parent b9a79a6 commit 8b978e9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nginx_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,15 @@ func main() {

log.Printf("Starting Server: %s", *listeningAddress)
http.Handle(*metricsEndpoint, prometheus.Handler())
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`<html>
<head><title>Nginx Exporter</title></head>
<body>
<h1>Nginx Exporter</h1>
<p><a href="` + *metricsEndpoint + `">Metrics</a></p>
</body>
</html>`))
})

log.Fatal(http.ListenAndServe(*listeningAddress, nil))
}

0 comments on commit 8b978e9

Please sign in to comment.