working commit
This commit is contained in:
@@ -30,6 +30,10 @@ func (rout *Router) AddRoute(method, path string, handlerFunc HandlerFunc) {
|
||||
rout.routeHandler.AddRoute(method, path, handlerFunc)
|
||||
}
|
||||
|
||||
func (rout *Router) Head(path string, handlerFunc HandlerFunc) {
|
||||
rout.routeHandler.AddRoute("HEAD", path, handlerFunc)
|
||||
}
|
||||
|
||||
func (rout *Router) Get(path string, handlerFunc HandlerFunc) {
|
||||
rout.routeHandler.AddRoute("GET", path, handlerFunc)
|
||||
}
|
||||
@@ -38,6 +42,10 @@ func (rout *Router) Post(path string, handlerFunc HandlerFunc) {
|
||||
rout.routeHandler.AddRoute("POST", path, handlerFunc)
|
||||
}
|
||||
|
||||
func (rout *Router) Put(path string, handlerFunc HandlerFunc) {
|
||||
rout.routeHandler.AddRoute("PUT", path, handlerFunc)
|
||||
}
|
||||
|
||||
func (rout *Router) ServeHTTP(writer http.ResponseWriter, req *http.Request) {
|
||||
rctx := NewContext(writer, req)
|
||||
rout.routeHandler.ServeHTTP(rctx)
|
||||
|
||||
Reference in New Issue
Block a user