How to test and develop AWS lambda functions locally with nodejs?

Опубликовано: 16 Июнь 2022
на канале: BiteSize Academy
18,654
257

⚡️ Blog post and source code: https://www.undefinedapps.com/post/te...

In this video we build a nodejs lambda function while running and testing it locally.

The lambda function that gets arguments from query params, uses axios to download the html of a website, uses cherio to parse out the title of the page and then saves the html file to S3 and returns a json response back to the user.

We write local tests for the function using mocha and sinon (to create stubs).

The video also covers:
creating and deploying lambda functions to AWS
setting up an S3 bucket
running the lambda function from a public url
managing lambda releases
setting up github actions to deploy to AWS on 'git push'

0:00 intro
0:31 explain & demo the function we're testing
1:40 create and run the lambda locally
3:54 create the lambda function on AWS + permissions
4:34 bundle & deploy our local code to AWS
6:21 create a public url to access our function
7:14 write the code to download the html and parse the title (using axios and cherio)
8:52 manage the release of our function
9:45 write tests using mocha and sinon
12:27 create a stub for axios.get() using sinon
15:25 write the code to save files to S3 (using aws-sdk)
12:27 create a stub for S3
17:25 create an S3 bucket on AWS + permissions
18:15 run the function in production
19:06 adjust the tests
19:42 create a GitHub action
21:27 deploy to aws on every 'git push'
22:58 use our new workflow
26:16 create integration e2e tests

⭐️ Subscribe for more content: https://newsletter.undefinedapps.com/

#aws #lambda #nodejs


Смотрите видео How to test and develop AWS lambda functions locally with nodejs? онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь BiteSize Academy 16 Июнь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 18,654 раз и оно понравилось 257 людям.