UNPKG

670 BMarkdownView Raw
1# Changelog
2
3## v1.0.0
4
5### `.use` supports array of middlewares
6
7You can now pass an array of middlewares to `.use` [#288](https://github.com/middyjs/middy/pull/288) by [@alexdebrie](https://github.com/alexdebrie)
8
9```javascript
10const middy = require('@middy/core')
11const middleware1 = require('sample-middleware1')
12const middleware2 = require('sample-middleware2')
13const middleware3 = require('sample-middleware3')
14const middlewares = [middleware1(), middleware2(), middleware3()]
15
16const originalHandler = (event, context, callback) => {
17 /* your business logic */
18}
19
20const handler = middy(originalHandler)
21
22handler.use(middlewares)
23
24module.exports = { handler }
25```