From 0d693b344c48fc878796fa4071fc37ec57faaa4d Mon Sep 17 00:00:00 2001 From: Marcos Lilljedahl Date: Sat, 8 Oct 2016 03:26:22 +0200 Subject: [PATCH] Add ping handler and listen on tcp4 addresses --- api.go | 3 ++- handlers/ping.go | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 handlers/ping.go diff --git a/api.go b/api.go index be62751..4e17dfa 100644 --- a/api.go +++ b/api.go @@ -14,6 +14,7 @@ import ( func main() { mux := bone.New() + mux.Get("/ping", http.HandlerFunc(handlers.Ping)) mux.Get("/", http.HandlerFunc(handlers.NewSession)) mux.Get("/sessions/:sessionId", http.HandlerFunc(handlers.GetSession)) mux.Post("/sessions/:sessionId/instances", http.HandlerFunc(handlers.NewInstance)) @@ -30,6 +31,6 @@ func main() { n := negroni.Classic() n.UseHandler(mux) - log.Fatal(http.ListenAndServe(":3000", n)) + log.Fatal(http.ListenAndServe("0.0.0.0:3000", n)) } diff --git a/handlers/ping.go b/handlers/ping.go new file mode 100644 index 0000000..66a41be --- /dev/null +++ b/handlers/ping.go @@ -0,0 +1,6 @@ +package handlers + +import "net/http" + +func Ping(rw http.ResponseWriter, req *http.Request) { +}