UNPKG

@nestjs/platform-express

Version:

Run NestJS on Express: the HTTP adapter with Express middleware, file uploads through Multer, static assets and view engines.

16 lines (15 loc) • 352 B
const rawBodyParser = (req, _res, buffer) => { if (Buffer.isBuffer(buffer)) { req.rawBody = buffer; } return true; }; export function getBodyParserOptions(parser, rawBody, options) { if (rawBody === true) { return { ...options, verify: rawBodyParser, }; } return options || {}; }