This commit is contained in:
aozhiwei 2020-12-16 16:02:12 +08:00
parent 8f0700f501
commit 60518a8f3c

View File

@ -91,3 +91,11 @@ func (this *HttpServer) RegisterHandle(c string, a string,
handleName := c + "$" + a
this.handlers[handleName] = handle
}
func (this *HttpServer) RegisterRestHandle(pattern string,
handle func(*http.ResponseWriter, *http.Request)) {
http.HandleFunc(pattern,
func (w http.ResponseWriter, r *http.Request) {
handle(&w, r)
})
}