Skip to content

Commit

Permalink
fix: add handler for /
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirk authored and vilhelmprytz committed Oct 8, 2023
1 parent 9437447 commit 2071bc5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions areca_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,16 @@ func main() {
level.Info(logger).Log("msg", "Build context", "build_context", version.BuildContext())

http.Handle("/metrics", promhttp.Handler())
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`<html>
<head><title>Areca Exporter</title></head>
<body>
<h1>Areca Exporter</h1>
<p><a href="/metrics">Metrics</a></p>
</body>
</html>`))
})

srv := &http.Server{}
if err := web.ListenAndServe(srv, toolkitFlags, logger); err != nil {
level.Error(logger).Log("err", err)
Expand Down

0 comments on commit 2071bc5

Please sign in to comment.