Skip to content

Commit

Permalink
feat: Add homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
Bpazy committed May 4, 2024
1 parent 789b9f5 commit e850aa9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/padavan_exporter/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"fmt"
"github.com/Bpazy/padavan_exporter/collector"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
Expand Down Expand Up @@ -48,6 +49,10 @@ func main() {
http.HandleFunc("/metrics", func(w http.ResponseWriter, r *http.Request) {
h.ServeHTTP(w, r)
})
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
b := ` <html> <head> <title>webhook-forwarder</title> </head> <body> <span>Here is <a href="https://github.com/Bpazy/padavan_exporter">padavan_exporter</a></span> </body> </html>`
_, _ = fmt.Fprintln(w, b)
})

log.Printf("Start server at %s", *la)
log.Fatal(http.ListenAndServe(*la, nil))
Expand Down

0 comments on commit e850aa9

Please sign in to comment.