Merge pull request #2497 from Si1kIfY/patch-1

Update api-gateway.md docs to include note about parsing JSON event body
This commit is contained in:
Eslam λ Hefnawy 2016-10-24 15:18:12 +07:00 committed by GitHub
commit d4e7f35891

View File

@ -133,6 +133,11 @@ exports.handler = function(event, context, callback) {
};
```
**Note:** When the body is a JSON-Document, you must parse it yourself:
```
JSON.parse(event.body);
```
**Note:** If you want to use CORS with the lambda-proxy integration, remember to include `Access-Control-Allow-Origin` in your returned headers object.
Take a look at the [AWS documentation](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-api-as-simple-proxy-for-lambda.html)