Skip to content

Commit c4a413c

Browse files
authored
Updated API Endpoint documentation
1 parent 95cd2b8 commit c4a413c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.rst

+14
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,20 @@ Under API endpoint type select "API Gateway".
121121

122122
Next change Method to ``POST`` and Security to "Open" and click submit (NOTE: you should secure this for use in production, open security is used for demo purposes).
123123

124+
At last you need to change the return value of the function to comply with the standard defined for the API Gateway endpoint, the function should now look like this:
125+
126+
.. code:: python
127+
128+
def handler(event, context):
129+
# Your code goes here!
130+
e = event.get('e')
131+
pi = event.get('pi')
132+
return {
133+
"statusCode": 200,
134+
"headers": { "Content-Type": "application/json"},
135+
"body": e + pi
136+
}
137+
124138
Now try and run:
125139

126140
.. code:: bash

0 commit comments

Comments
 (0)