UNPKG

@adonisjs/bodyparser

Version:

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

51 lines (50 loc) 979 B
function defineConfig(config) { return { allowedMethods: config.allowedMethods || [ "POST", "PUT", "PATCH", "DELETE" ], form: { encoding: "utf-8", limit: "1mb", queryString: {}, types: ["application/x-www-form-urlencoded"], convertEmptyStringsToNull: true, trimWhitespaces: true, ...config.form }, json: { encoding: "utf-8", limit: "1mb", strict: true, types: [ "application/json", "application/json-patch+json", "application/vnd.api+json", "application/csp-report" ], convertEmptyStringsToNull: true, trimWhitespaces: true, ...config.json }, raw: { encoding: "utf-8", limit: "1mb", types: ["text/*"], ...config.raw }, multipart: { autoProcess: true, processManually: [], maxFields: 1e3, limit: "20mb", types: ["multipart/form-data"], convertEmptyStringsToNull: true, trimWhitespaces: true, ...config.multipart } }; } export { defineConfig as t };