Skip to content
Snippets Groups Projects
Commit 4da4e362 authored by Pedro's avatar Pedro
Browse files

Add welcome page

parent f8d07562
Branches
Tags
No related merge requests found
...@@ -305,8 +305,17 @@ func main() { ...@@ -305,8 +305,17 @@ func main() {
log.Infoln("Starting apache_exporter", version.Info()) log.Infoln("Starting apache_exporter", version.Info())
log.Infoln("Build context", version.BuildContext()) log.Infoln("Build context", version.BuildContext())
log.Infof("Starting Server: %s", *listeningAddress) log.Infof("Starting Server: %s", *listeningAddress)
http.Handle(*metricsEndpoint, prometheus.Handler()) http.Handle(*metricsEndpoint, prometheus.Handler())
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`<html>
<head><title>Apache Exporter</title></head>
<body>
<h1>Apache Exporter</h1>
<p><a href='` + *metricsEndpoint + `'>Metrics</a></p>
</body>
</html>`))
})
log.Fatal(http.ListenAndServe(*listeningAddress, nil)) log.Fatal(http.ListenAndServe(*listeningAddress, nil))
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment