Skip to content
Snippets Groups Projects
Commit 6605c92a authored by Kevin Lyda's avatar Kevin Lyda :speech_balloon:
Browse files

More tweaks on web server.

parent d072b3dd
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -8,15 +8,23 @@
package main
import (
"flag"
"fmt"
"log"
"net/http"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
var addr = flag.String("listen-address", ":8080", "Address for HTTP requests.")
func metricsHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Some metrics.")
}
func main() {
flag.Parse()
http.HandleFunc("/", metricsHandler)
http.ListenAndServe(":8080", nil)
http.Handle("/metrics", promhttp.Handler())
log.Fatal(http.ListenAndServe(*addr, nil))
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment