Skip to content

Commit

Permalink
Add handler for root (/) URL
Browse files Browse the repository at this point in the history
Signed-off-by: Renaud Gaubert <[email protected]>
  • Loading branch information
Renaud Gaubert committed Jun 3, 2020
1 parent b5736c9 commit 57396c4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ func NewMetricsServer(c *Config, metrics chan string) (*MetricsServer, func(), e
metrics: "",
}

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

router.HandleFunc("/health", serverv1.Health)
router.HandleFunc("/metrics", serverv1.Metrics)

Expand Down

0 comments on commit 57396c4

Please sign in to comment.