Added ping endpoint.

This commit is contained in:
Travis
2013-01-16 15:43:55 -08:00
parent 253c196f50
commit 35b04bc153

View File

@@ -88,6 +88,7 @@ func main() {
s := r.Headers("Iron-Router", "").Subrouter()
s.HandleFunc("/", AddWorker)
r.HandleFunc("/addworker", AddWorker)
r.HandleFunc("/ping", Ping) // for health
r.HandleFunc("/", ProxyFunc)
@@ -299,3 +300,7 @@ func putRoute(route *Route) (error) {
err = icache.Put(route.Host, &item)
return err
}
func Ping(w http.ResponseWriter, req *http.Request) {
fmt.Fprintln(w, "pong")
}