Skip to content

Instantly share code, notes, and snippets.

@AshanthaLahiru
Last active May 3, 2018 01:08
Show Gist options
  • Save AshanthaLahiru/4a9b2406bea8d64f8606c00b5c112932 to your computer and use it in GitHub Desktop.
Save AshanthaLahiru/4a9b2406bea8d64f8606c00b5c112932 to your computer and use it in GitHub Desktop.
Simple Lambda function that displays `Hello, ${name}`
'use strict';
module.exports.hello = (event, context, callback) => {
let user = 'User';
if(event.queryStringParameters.name) {
user = event.queryStringParameters.name
}
const response = {
statusCode: 200,
body: JSON.stringify({
message: `Hello, ${user}`,
}),
};
callback(null, response);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment