mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-07-14 01:57:32 +08:00
Add ping handler and listen on tcp4 addresses
This commit is contained in:
parent
dde49d8700
commit
0d693b344c
3
api.go
3
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))
|
||||
|
||||
}
|
||||
|
6
handlers/ping.go
Normal file
6
handlers/ping.go
Normal file
@ -0,0 +1,6 @@
|
||||
package handlers
|
||||
|
||||
import "net/http"
|
||||
|
||||
func Ping(rw http.ResponseWriter, req *http.Request) {
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user