You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -231,7 +231,7 @@ The `REQUEST` object contains a parsed and normalized request from API Gateway.
231
231
-`route`: The matched route of the request
232
232
-`requestContext`: The `requestContext` passed from the API Gateway
233
233
-`namespace` or `ns`: A reference to modules added to the app's namespace (see [namespaces](#namespaces))
234
-
-`cookies`: An object containing cookies sent from the browser (see the [cookie](#cookie)`RESPONSE` method)
234
+
-`cookies`: An object containing cookies sent from the browser (see the [cookie](#cookiename-value-options)`RESPONSE` method)
235
235
236
236
The request object can be used to pass additional information through the processing chain. For example, if you are using a piece of authentication middleware, you can add additional keys to the `REQUEST` object with information about the user. See [middleware](#middleware) for more information.
Convenience method for expiring cookies. Requires the `name` and optional `options` object as specified in the [cookie](#cookie) method. This method will automatically set the expiration time. However, most browsers require the same options to clear a cookie as was used to set it. E.g. if you set the `path` to "/admin" when you set the cookie, you must use this same value to clear it.
385
+
Convenience method for expiring cookies. Requires the `name` and optional `options` object as specified in the [cookie](#cookiename-value-options) method. This method will automatically set the expiration time. However, most browsers require the same options to clear a cookie as was used to set it. E.g. if you set the `path` to "/admin" when you set the cookie, you must use this same value to clear it.
The `callback` function supports promises, allowing you to perform additional tasks *after* the file is successfully loaded from the source. This can be used to perform additional synchronous tasks before returning control to the API execution.
450
450
451
+
**NOTE:** In order to access S3 files, your Lambda function must have `GetObject` access to the files you're attempting to access.
452
+
451
453
See [Enabling Binary Support](#enabling-binary-support) for more information.
452
454
453
455
## Enabling Binary Support
454
-
To enable binary support, you need to add `*/*` under Binary Media Types in API Gateway > APIs > [your api] -> Settings. This will also base64 encode all body content, but Lambda API will automatically decode it for you.
456
+
To enable binary support, you need to add `*/*` under "Binary Media Types" in **API Gateway** -> **APIs** -> **[your api]** -> **Settings**. This will also `base64` encode all body content, but Lambda API will automatically decode it for you.
455
457
456
458

457
-
*Add*`*/*`*to Binary Media Types*
459
+
*Add*`*/*`*to Binary Media Types*
458
460
459
461
## Path Parameters
460
462
Path parameters are extracted from the path sent in by API Gateway. Although API Gateway supports path parameters, the API doesn't use these values but insteads extracts them from the actual path. This gives you more flexibility with the API Gateway configuration. Path parameters are defined in routes using a colon `:` as a prefix.
@@ -586,11 +588,7 @@ Conditional route support could be added via middleware or with conditional logi
586
588
## Configuring Routes in API Gateway
587
589
Routes must be configured in API Gateway in order to support routing to the Lambda function. The easiest way to support all of your routes without recreating them is to use [API Gateway's Proxy Integration](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html#api-gateway-proxy-resource?icmpid=docs_apigateway_console).
588
590
589
-
Simply create one`{proxy+}` route that uses the `ANY` method and all requests will be routed to your Lambda function and processed by the `lambda-api` module.
591
+
Simply create a`{proxy+}` route that uses the `ANY` method and all requests will be routed to your Lambda function and processed by the `lambda-api` module. In order for a "root" path mapping to work, you also need to create an `ANY` route for `/`.
590
592
591
593
## Contributions
592
594
Contributions, ideas and bug reports are welcome and greatly appreciated. Please add [issues](https://github.com/jeremydaly/lambda-api/issues) for suggestions and bugs reports.
593
-
594
-
595
-
## NOTES
596
-
In order for "root" path mapping to work, you need to also create an `ANY` route for `/` in addition to your `{proxy+}` route.
0 commit comments