Body parsing middleware for API Gateway.
npm i api-gateway-body-parser
import { apiGatewayBodyParser } from 'api-gateway-body-parser';
const app = express();
app.use(apiGatewayBodyParser({
binaryMediaTypes: [ 'image/*' ],
limit: '10mb',
}));
Generate a middleware to parse the request body as binary data.
binaryMediaTypes
- An array of string that
Content-Type
is assumed as binary data.
- An array of string that
limit
- A maximum limit of the request body.
The generated middleware adds body
and isBase64Encoded
properties to req
.
MIT