wikipedia-game-solver/apps/api/config/bodyparser.ts
Théo LUDWIG 4add77856e
All checks were successful
Chromatic / chromatic (push) Successful in 2m58s
CI / ci (push) Successful in 4m43s
CI / commitlint (push) Successful in 15s
chore: try Adonis Tuyau
2024-08-16 01:50:11 +01:00

51 lines
1.2 KiB
TypeScript

import { defineConfig } from "@adonisjs/core/bodyparser"
const bodyParserConfig = defineConfig({
/**
* The bodyparser middleware will parse the request body for the following HTTP methods.
*/
allowedMethods: ["POST", "PUT", "PATCH", "DELETE"],
/**
* Config for the "application/x-www-form-urlencoded" content-type parser.
*/
form: {
convertEmptyStringsToNull: true,
types: ["application/x-www-form-urlencoded"],
},
/**
* Config for the JSON parser.
*/
json: {
convertEmptyStringsToNull: true,
types: [
"application/json",
"application/json-patch+json",
"application/vnd.api+json",
"application/csp-report",
],
},
/**
* Config for the "multipart/form-data" content-type parser.
* File uploads are handled by the multipart parser.
*/
multipart: {
/**
* Enabling auto process allows bodyparser middleware to move all uploaded files inside the tmp folder of your operating system.
*/
autoProcess: true,
convertEmptyStringsToNull: true,
processManually: [],
/**
* Maximum limit of data to parse including all files and fields.
*/
limit: "20mb",
types: ["multipart/form-data"],
},
})
export default bodyParserConfig