Skip to content

Commit 2566c6d

Browse files
committed
added Wiring to an API endpoint section
1 parent b65d1aa commit 2566c6d

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.rst

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,22 @@ When you're ready to deploy your code to Lambda simply run:
9898
9999
The deploy script will evaluate your virtualenv and identify your project dependencies. It will package these up along with your handler function to a zip file that it then uploads to AWS Lambda.
100100

101-
You can now log into the AWS Lambda management console to verify the code deployed successfully.
101+
You can now log into the `AWS Lambda management console <https://console.aws.amazon.com/lambda/>`_ to verify the code deployed successfully.
102+
103+
Wiring to an API endpoint
104+
=========================
105+
106+
If you're looking to develop a simple microservice you can easily wire your function up to an http endpoint.
107+
108+
Begin by navigating to your `AWS Lambda management console <https://console.aws.amazon.com/lambda/>`_ and clicking on your function. Click the API Endpoints tab and click "Add API endpoint".
109+
110+
Under API endpoint type select "API Gateway".
111+
112+
Next change Method to ``POST`` and Security to "Open" and click submit (NOTE: you should secure this for use in production, open security is use for demo purposes).
113+
114+
Now try and run:
115+
116+
.. code:: bash
117+
118+
$ curl -H "Content-Type: application/json" -X POST -d '{"pi": 3.14, "e": 2.718}' https://<API endpoint URL>
119+
# 5.8580000000000005

0 commit comments

Comments
 (0)