Adds logging
This commit is contained in:
parent
0964cece0c
commit
efb2d846c3
12
main.go
12
main.go
@ -8,7 +8,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
const version = "v0.0.9"
|
const version = "v0.0.10"
|
||||||
|
|
||||||
type v struct {
|
type v struct {
|
||||||
Hostname string `json:"hostname"`
|
Hostname string `json:"hostname"`
|
||||||
@ -35,11 +35,13 @@ func main() {
|
|||||||
fmt.Fprintf(w, "%v\n", line)
|
fmt.Fprintf(w, "%v\n", line)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
http.HandleFunc("/live", health)
|
http.HandleFunc("/live", func(w http.ResponseWriter, req *http.Request) {
|
||||||
http.HandleFunc("/ready", health)
|
log.Printf("live")
|
||||||
|
})
|
||||||
|
http.HandleFunc("/ready", func(w http.ResponseWriter, req *http.Request) {
|
||||||
|
log.Printf("ready")
|
||||||
|
})
|
||||||
if err := http.ListenAndServe(":8080", nil); err != nil {
|
if err := http.ListenAndServe(":8080", nil); err != nil {
|
||||||
log.Fatalf("listen and serve: %v", err)
|
log.Fatalf("listen and serve: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func health(w http.ResponseWriter, req *http.Request) {}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user