Start Twilio webhook.
This commit is contained in:
parent
42aa585bd0
commit
caa92def41
|
@ -26,5 +26,6 @@ func AddRoute(pattern string, handler func(http.ResponseWriter, *http.Request))
|
|||
}
|
||||
|
||||
func Start(addr string) {
|
||||
log.Printf("starting HTTP server on %s", addr)
|
||||
go log.Print(http.ListenAndServe(addr, server.router))
|
||||
}
|
||||
|
|
|
@ -47,3 +47,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
|||
log.Printf("twilio receive hook: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
func Start() error {
|
||||
http.AddRoute("/twilio", handler)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue