Cloud Resume Challenge - Part 2 - Back-End

At this part, I will cover developing the visitor counter by using python, javascript, API and AWS SAM for deployment of services. project3

Cloud Resume Challenge - Part 2 - Backend

For visitor counter, I needed to use a variety of AWS services. A database to contain visitor number and a Lambda function to increment the number upon visits that triggers the function. To finish up the template, also needed a rest API to tie them all. The yaml deployment is the easier part for this challenge, I deployed a DynamoDB table by a short code snippet and created a Lambda resource adding API (/get method) event to trigger the function and eventually tying it to the counter table to increment the number.

You need to leverage boto3 library on Python to create the actual function to increment and update the number on DynamoDB table. Moreover, you need to add a script in your HTML file to fetch the API response of your API Gateway. Then you will be able to see the visitor count on your website. project2

Final Thoughts on Part 2

The most challenging part of this project for me was to figure out CORS error I’ve been getting from my API. Turns out, the solution was easy using the AWS console, but as I wanted to manage all in code, I needed to add some header specifications to my API response. project2
All in all, it was a good learning experience regarding rest APIs and HTTP headers.


Contact Me

I'm interested in new career opportunities. If you have any enquiries, feel free to contact me.

E-mail:
askin.inan@outlook.com
Location:
Istanbul, Turkey

Send a Message

You are
th visitor.