UNPKG

@adonisjs/bodyparser

Version:

BodyParser middleware for AdonisJS http server to read and parse request body

24 lines (23 loc) 668 B
import { type BodyParserConfig, type BodyParserOptionalConfig } from './types.ts'; /** * Defines configuration for the bodyparser middleware. The provided configuration * is merged with sensible defaults for parsing JSON, form data, raw text, and * multipart requests. * * @param config - Optional configuration overrides for body parsing * * @example * ```ts * export default defineConfig({ * allowedMethods: ['POST', 'PUT', 'PATCH'], * json: { * limit: '2mb' * }, * multipart: { * autoProcess: true, * limit: '50mb' * } * }) * ``` */ export declare function defineConfig(config: BodyParserOptionalConfig): BodyParserConfig;