Skip to content

Commit

Permalink
Provide information page on "/"
Browse files Browse the repository at this point in the history
  • Loading branch information
mgumz committed Feb 13, 2025
1 parent b7d3689 commit e3b2223
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/mtr-exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ func main() {
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "OK")
})
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, `<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>mtr-exporter</title>
</head>
<body>
mtr-exporter - <a href="https://github.com/mgumz/mtr-exporter">https://github.com/mgumz/mtr-exporter<a><br>
see <a href="/metrics">/metrics</a>.
</body>`)
})

log.Println("serving /metrics at", mtef.bindAddr, "...")
log.Fatal(http.ListenAndServe(mtef.bindAddr, nil))
Expand Down

0 comments on commit e3b2223

Please sign in to comment.