v1.0.0-beta.4
·
40 commits
to main
since this release
π¨ Breaking Changes π¨
Event Iterator Keep Alive
We move configs for Event Iterator Keep Alive
from .handle
to handler options
(define when creating handler)
Rename internal APIs
HandlerPlugin
->StandardHandlerPlugin
ClientOptions
->FriendlyClientOptions
ClientOptionsOut
->ClientOptions
ClientPlugin
->StandardLinkPlugin
StandardHandleOptions
->FriendlyStandardHandleOptions
π Features π
Body Limit Plugin
The Body Limit Plugin restricts the size of the request body.
const handler = new RPCHandler(router, {
plugins: [
new BodyLimitPlugin({
maxBodySize: 1024 * 1024, // 1MB
}),
],
})
No need manually check prefix
export async function fetch(request: Request): Promise<Response> {
- const url = new URL(request.url)
-
- if (url.pathname.startsWith('/rpc')) {
const { response } = await handler.handle(request, {
prefix: '/rpc',
context: {} // Provide initial context if needed
})
if (response)
return response
- }
return new Response('Not found', { status: 404 })
}
No significant changes