Try to configure the API Gateway yourself using the knowledge from the recent module. Tips can be seen below.
Cross-Origin request settings. Please note that both GET and POST requests (to record a vote and get results) are allowed, and two request sources are connected: my-vote (voting) and my-vote-result (results).
Notice how accepted origins are not s3 buckets - but only 2 cloudfronts!
In this example, I used one path /my-vote
, and made the routing based on the request method GET
/POST
. This is not mandatory, you can do two different ways.
This API must support two functions from AWS Lambda as integrations. This repository contains their code: