File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -383,14 +383,13 @@ func main() {
383
383
registry .MustRegister (collector .NewNginxCollector (ossClient .(* client.NginxClient ), "nginx" , constLabels .labels ))
384
384
}
385
385
http .Handle (* metricsPath , promhttp .HandlerFor (registry , promhttp.HandlerOpts {}))
386
+
386
387
http .HandleFunc ("/" , func (w http.ResponseWriter , r * http.Request ) {
387
- _ , err := w .Write ([]byte (`<html>
388
- <head><title>NGINX Exporter</title></head>
389
- <body>
388
+ _ , err := fmt .Fprintf (w , `<!DOCTYPE html>
389
+ <title>NGINX Exporter</title>
390
390
<h1>NGINX Exporter</h1>
391
- <p><a href='/metrics'>Metrics</a></p>
392
- </body>
393
- </html>` ))
391
+ <p><a href=%q>Metrics</a></p>` ,
392
+ * metricsPath )
394
393
if err != nil {
395
394
log .Printf ("Error while sending a response for the '/' path: %v" , err )
396
395
}
You can’t perform that action at this time.
0 commit comments