dwyl / learn-aws-lambda

✨ Learn how to use AWS Lambda to easily create infinitely scalable web services
1.05k stars 202 forks source link

hello-world fn readme update #108

Closed Cleop closed 5 years ago

Cleop commented 5 years ago

I've been following the hello-world example in the readme and come across a few subtle differences from updates from AWS and so I intend on popping in the changes to help make the instructions easier to follow.

nelsonic commented 5 years ago

@Cleop thanks. yes, the code can use an update to "modern" node.js. 👍

Cleop commented 5 years ago

The default fn now uses async and I'm not really sure what this is doing but I ran the tests without it and with it and both pass.

exports.handler = async (event, context) => {
    console.log('value1 =', event.key1);
    console.log('value2 =', event.key2);
    context.succeed(event.key1 + " " + event.key2);
};

I'm going to try to find out but would welcome suggestions from anyone who already has an idea.

nelsonic commented 5 years ago

async => #ModernJS ... 🙄 (AKA "magic")

markhu commented 5 years ago

This repo was supposed to be about learning AWS Lambda, not NodeJS. Just saying.

iteles commented 5 years ago

@markhu It very much is! That's why it's a good idea to not have people 'trip up' or come out of the flow of the tutorial because of something like the code in an example. These are meant to aid people's understanding, not throw up tangential questions that take them off topic.

Updating these makes following the tutorial (and learning AWS Lambda) a smoother experience. 👍

markhu commented 5 years ago

Great point. In that spirit, I humbly offer issue #111 / PR #110 that fixes numerous distracting markdown formatting mistakes. To make the source code review less onerous, use Diff settings "Split" & "Hide whitespace." Or just compare/review the rendered doc in another tab/window.

Cleop commented 5 years ago

Closing as this has now been updated and merged 👍