Migrate from V1 to V2
In v1, we were using Oak internally. V2 switched to Hono for improved performances (cf our benchmark).
There is only one breaking change, related to the HTTPContext structure
HTTPContext's request and response object
HTTPContext
moved from being a superset of Oak's context to being a superset of Hono's context.
This means that instead of using context.response
and context.request
we have to use context.res
and context.req
.
context.res
is simply the response object that will be sent back to client (except if your controller method return something, then your controller method's returned value take precedence).
context.req
is an HonoRequest
's instance.