Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lambda-request-handler

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambda-request-handler - npm Package Compare versions

Comparing version 0.4.4 to 0.5.0

2

dist/compile/eventToRequestOptions.js

@@ -17,3 +17,3 @@ "use strict";

var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);

@@ -20,0 +20,0 @@ return result;

@@ -0,1 +1,2 @@

/// <reference types="node" />
import { RequestListener } from 'http';

@@ -16,3 +17,4 @@ import * as apigw from './types';

nestHandler: (nestApp: any) => Promise<any>;
fastifyHandler: (fastifyBuilder: (options: object) => any) => (options: object) => Promise<RequestListener>;
};
export = handler;

@@ -46,2 +46,3 @@ "use strict";

handler.nestHandler = in_process_request_1.default.nestHandler;
handler.fastifyHandler = in_process_request_1.default.fastifyHandler;
module.exports = handler;
{
"name": "lambda-request-handler",
"version": "0.4.4",
"version": "0.5.0",
"license": "(MIT OR Apache-2.0)",

@@ -28,2 +28,4 @@ "scripts": {

"connect",
"apollo",
"fastify",
"http",

@@ -40,4 +42,4 @@ "request",

"dependencies": {
"in-process-request": "^0.2.1",
"isutf8": "^3.0.0"
"in-process-request": "^0.3.0",
"isutf8": "^3.1.1"
},

@@ -47,14 +49,14 @@ "devDependencies": {

"@types/cookie-parser": "^1.4.2",
"@types/express": "^4.17.6",
"@types/jest": "^25.2.3",
"@types/node": "^14.0.4",
"@types/express": "^4.17.8",
"@types/jest": "^26.0.15",
"@types/node": "^14.14.6",
"compression": "^1.7.4",
"cookie-parser": "^1.4.5",
"ejs": "^3.1.3",
"ejs": "^3.1.5",
"express": "^4.17.1",
"jest": "^26.0.1",
"ts-jest": "^26.0.0",
"ts-node": "^8.10.1",
"typescript": "^3.9.3"
"jest": "^26.6.3",
"ts-jest": "^26.4.3",
"ts-node": "^9.0.0",
"typescript": "^4.0.5"
}
}

@@ -13,5 +13,8 @@ # lambda-request-handler

* Hapi v19 (only supported in `nodejs12.x` runtime)
* Hapi v20 (only supported in `nodejs12.x` runtime)
* NestJS v7
* Connect v3
* Koa v2
* Polka
* Fastify v3

@@ -179,1 +182,24 @@ Inspired by [aws-serverless-express](https://github.com/awslabs/aws-serverless-express)

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`
### Polka
```javascript
const polka = require('polka')
const lambdaRequestHandler = require('lambda-request-handler')
const app = polka()
app.get('/user/:id', (req, res) => {
res.json({
id: req.params.id,
lambdaRequestId: req.header('x-aws-lambda-request-id')
name: 'John'
})
})
const handler = lambdaRequestHandler(app.handler.bind(app))
module.exports = { handler }
```
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`
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc