oRPC Body Limit Plugin
A plugin for oRPC to limit the request body size.
SKILL.mdskills/orpc-body-limit/SKILL.md
GitHubBody Limit Plugin
The Body Limit Plugin restricts the size of the request body.
Import
import { BodyLimitPlugin } from '@orpc/server/fetch'
import { BodyLimitPlugin } from '@orpc/server/node'
Setup
const handler = new RPCHandler(router, {
plugins: [
new BodyLimitPlugin({
maxBodySize: 1024 * 1024, // 1MB
}),
],
})
The
handlercan be any supported oRPC handler —RPCHandler,OpenAPIHandler, or a custom handler.