Skip to content

Commit

Permalink
close #69 with added API Gateway inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydaly committed Nov 15, 2018
1 parent 35e7e1b commit 85accb4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -394,6 +394,9 @@ The `REQUEST` object contains a parsed and normalized request from API Gateway.
- `rawBody`: If the `isBase64Encoded` flag is `true`, this is a copy of the original, base64 encoded body
- `route`: The matched route of the request
- `requestContext`: The `requestContext` passed from the API Gateway
- `pathParameters`: The `pathParameters` passed from the API Gateway
- `stageVariables`: The `stageVariables` passed from the API Gateway
- `isBase64Encoded`: The `isBase64Encoded` boolean passed from the API Gateway
- `auth`: An object containing the `type` and `value` of an authorization header. Currently supports `Bearer`, `Basic`, `OAuth`, and `Digest` schemas. For the `Basic` schema, the object is extended with additional fields for username/password. For the `OAuth` schema, the object is extended with key/value pairs of the supplied OAuth 1.0 values.
- `namespace` or `ns`: A reference to modules added to the app's namespace (see [namespaces](#namespaces))
- `cookies`: An object containing cookies sent from the browser (see the [cookie](#cookiename-value-options) `RESPONSE` method)
Expand Down
9 changes: 9 additions & 0 deletions lib/request.js
Expand Up @@ -93,6 +93,15 @@ class REQUEST {
// Set the requestContext
this.requestContext = this.app._event.requestContext || {}

// Set the pathParameters
this.pathParameters = this.app._event.pathParameters || {}

// Set the stageVariables
this.stageVariables = this.app._event.stageVariables || {}

// Set the isBase64Encoded
this.isBase64Encoded = this.app._event.isBase64Encoded || {}

// Add context
this.context = this.app.context && typeof this.app.context === 'object' ? this.app.context : {}

Expand Down

0 comments on commit 85accb4

Please sign in to comment.