middy
Advanced tools
Comparing version 0.19.2 to 0.19.3
{ | ||
"name": "middy", | ||
"version": "0.19.2", | ||
"version": "0.19.3", | ||
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -65,3 +65,3 @@ <div align="center"> | ||
const middy = require('middy') | ||
const { urlEncodeBodyParser, validator, httpErrorHandler } = require('middy/middlewares') | ||
const { jsonBodyParser, validator, httpErrorHandler } = require('middy/middlewares') | ||
@@ -102,3 +102,3 @@ // This is your common handler, in no way different than what you are used to doing every day | ||
const handler = middy(processPayment) | ||
.use(urlEncodeBodyParser()) // parses the request body when it's a JSON and converts it to an object | ||
.use(jsonBodyParser()) // parses the request body when it's a JSON and converts it to an object | ||
.use(validator({inputSchema})) // validates the input | ||
@@ -512,2 +512,3 @@ .use(httpErrorHandler()) // handles common http errors and returns proper responses | ||
- [`doNotWaitForEmptyEventLoop`](/docs/middlewares.md#donotwaitforemptyeventloop): Sets callbackWaitsForEmptyEventLoop property to false | ||
- [`functionShield`](/docs/middlewares.md#functionshield): Hardens AWS Lambda execution environment | ||
- [`httpContentNegotiation`](/docs/middlewares.md#httpcontentnegotiation): Parses `Accept-*` headers and provides utilities for content negotiation (charset, encoding, language and media type) for HTTP requests | ||
@@ -514,0 +515,0 @@ - [`httpErrorHandler`](/docs/middlewares.md#httperrorhandler): Creates a proper HTTP response for errors that are created with the [http-errors](https://www.npmjs.com/package/http-errors) module and represents proper HTTP errors. |
160360
662