import { bodyLimit } from "https://deno.land/x/hono@v4.3.6/middleware/body-limit/index.ts";
Body Limit Middleware
Examples
Example 1
Example 1
app.post(
'/hello',
bodyLimit({
maxSize: 100 * 1024, // 100kb
onError: (c) => {
return c.text('overflow :(', 413)
}
}),
(c) => {
return c.text('pass :)')
}
)
type
(options: BodyLimitOptions) => MiddlewareHandler