mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
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:
commit
d4e7f35891
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user