You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

24 lines
414 B

package main
import (
"log"
"net/http"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
func runHTTPServer()error{
http.Handle("/metrics", promhttp.Handler())
http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request){
w.Write([]byte("hello world!"))
})
return http.ListenAndServe("localhost:8080", nil)
}
func main(){
err := runHTTPServer()
if err != nil {
log.Fatal(err)
}
}