New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lambda-router-adapter

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambda-router-adapter - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

2

package.json
{
"name": "lambda-router-adapter",
"version": "1.0.9",
"version": "1.0.10",
"description": "Adapts Lambda Router Requests and Responses to NodeJS HTTP Request and Responses",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,1 +8,54 @@ # lambda-router-adapter

project.
## Usage
### Express 4.x
lambda-router-adapter has built in support fore express 4.x.
Use the newExpressHandler method to convert an express app into a lambda
handler.
var express = require('express');
var adapter =require('lambda-router-adapter');
var app = express();
app.get('/', function(req, res) {
res.send('Hello World');
});
module.exports.handler = adapter.newExpressHandler(app);
### Generic
#### convertRequest
Convert a lambda event into a LambdaHttpRequest, which has the same interface
as a NodeJS http request.
The lambda event must have the following fields:
* url
* method
The lambda event could have the following fields:
* body
* headers
#### newResponse
Create a new LambdaHttpResponse which has the same interface as a NodeJS http
response.
#### convertResponse
Serialise the LambdaHttpResponse into an object that can be sent as a lambda
response.
The response will have the following fields:
* statusCode
* statusMessage
* headers
* body or bodyBase64
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