Last active
May 3, 2018 01:08
-
-
Save AshanthaLahiru/4a9b2406bea8d64f8606c00b5c112932 to your computer and use it in GitHub Desktop.
Simple Lambda function that displays `Hello, ${name}`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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