mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-21 22:54:58 +00:00
Modified harness to bootstrap using the go engine. Skeleton app updated to use new request code
This commit is contained in:
@@ -47,10 +47,12 @@ type Harness struct {
|
||||
proxy *httputil.ReverseProxy
|
||||
}
|
||||
|
||||
func renderError(w http.ResponseWriter, r *http.Request, err error) {
|
||||
req, resp := revel.NewRequest(r), revel.NewResponse(w)
|
||||
c := revel.NewController(req, resp)
|
||||
c.RenderError(err).Apply(req, resp)
|
||||
func renderError(iw http.ResponseWriter, ir *http.Request, err error) {
|
||||
context := revel.NewGOContext(nil)
|
||||
context.Request.SetRequest(ir)
|
||||
context.Response.SetResponse(iw)
|
||||
c := revel.NewController(context)
|
||||
c.RenderError(err).Apply(c.Request, c.Response)
|
||||
}
|
||||
|
||||
// ServeHTTP handles all requests.
|
||||
|
||||
Reference in New Issue
Block a user