Handle
Handle
is a request handler, it receives a context instance, and write response to client:
func home(ctx *clevergo.Context) error {
return ctx.String(http.StatusOK, "hello world")
}
If something wrong, either return the error to Error Handler, or write error response directly and then return nil
.
See Routing for registering request handlers.
Context
Context
is a wrapper of *http.Request
and http.ResponseWriter
.