Skip to content

Commit 801ff64

Browse files
committed
Support for Polka
1 parent 10c2137 commit 801ff64

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The list of supported frameworks matches [in-process-request](https://github.com
1414
* NestJS v7
1515
* Connect v3
1616
* Koa v2
17+
* Polka
1718

1819
Inspired by [aws-serverless-express](https://github.com/awslabs/aws-serverless-express)
1920

@@ -176,3 +177,26 @@ exports = { handler }
176177
```
177178

178179
If the above file in your Lambda source was called `index.ts`, compiled to `index.js` then the name of the handler in the Lambda configuration is `index.handler`
180+
181+
### Polka
182+
183+
```javascript
184+
const polka = require('polka')
185+
const lambdaRequestHandler = require('lambda-request-handler')
186+
187+
const app = polka()
188+
189+
app.get('/user/:id', (req, res) => {
190+
res.json({
191+
id: req.params.id,
192+
lambdaRequestId: req.header('x-aws-lambda-request-id')
193+
name: 'John'
194+
})
195+
})
196+
197+
const handler = lambdaRequestHandler(app.handler.bind(app))
198+
199+
module.exports = { handler }
200+
```
201+
202+
If the above file in your Lambda source was called `index.js` then the name of the handler in the Lambda configuration is `index.handler`

0 commit comments

Comments
 (0)