Skip to content

Commit

Permalink
docs(common): Add docs on increasing max request size
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Jul 3, 2023
1 parent 4a10d67 commit e5bea23
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/core/src/common/types/common-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,28 @@ export type MiddlewareHandler = Type<any> | Function;
* Defines API middleware, set in the {@link ApiOptions}. Middleware can be either
* [Express middleware](https://expressjs.com/en/guide/using-middleware.html) or [NestJS middleware](https://docs.nestjs.com/middleware).
*
* ## Increasing the maximum request body size limit
*
* Internally, Vendure relies on the body-parser middleware to parse incoming JSON data. By default, the maximum
* body size is set to 100kb. Attempting to send a request with more than 100kb of JSON data will result in a
* `PayloadTooLargeError`. To increase this limit, we can manually configure the body-parser middleware:
*
* @example
* ```TypeScript
* import { VendureConfig } from '\@vendure/core';
* import { json } from 'body-parser';
*
* export const config: VendureConfig = {
* // ...
* apiOptions: {
* middleware: [{
* handler: json({ limit: '10mb' }),
* route: '*',
* beforeListen: true,
* }],
* },
* };
*
* @docsCategory Common
*/
export interface Middleware {
Expand Down

0 comments on commit e5bea23

Please sign in to comment.