Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/washingtonpost/lambda-http-proxy
Proxy http requests to lambda functions
https://github.com/washingtonpost/lambda-http-proxy
Last synced: 5 days ago
JSON representation
Proxy http requests to lambda functions
- Host: GitHub
- URL: https://github.com/washingtonpost/lambda-http-proxy
- Owner: washingtonpost
- Created: 2016-11-16T12:10:44.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-11-16T22:12:56.000Z (almost 3 years ago)
- Last Synced: 2024-04-14T11:14:06.095Z (7 months ago)
- Language: JavaScript
- Size: 49.8 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lambda HTTP Proxy
This module is used to standardize the http to lambda mapping and function invocation.## Usage
```
var lambda_http_proxy = require('lambda_http_proxy');
app.all('/api', lambda_http_proxy.invoke());
```The following headers are supported/required:
* x-FunctionName, Required, Lambda function name.
* x-LogType, Optional, None or Tail.
* x-Qualifier, Optional
* x-ViewType, Optional, default or simple; defaults to default.See the Lambda function params here for more information: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#invoke-property
The default response structure looks like:
```
{
StatusCode: data.StatusCode,
FunctionError: data.FunctionError,
LogResult: data.LogResult,
Payload: !_.isNil(data.Payload) ? JSON.parse(data.Payload) : null
}
```The simple response structure looks like:
```
{
}
```This module requires express.js