Handle

Handle is a request handler, it receives a context instance, and write response to client:

  1. func home(ctx *clevergo.Context) error {
  2. return ctx.String(http.StatusOK, "hello world")
  3. }

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.

See Request and Response.