Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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