Last active
August 9, 2020 01:05
-
-
Save ahmedsakr/faf95eca44bc28eda2d8b7e0f08eca44 to your computer and use it in GitHub Desktop.
requestFortune lambda for the Fortune Cookie Serverless application
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
const fortunes = [ | |
"A beautiful, smart, and loving person will be coming into your life.", | |
"A dubious friend may be an enemy in camouflage.", | |
"A faithful friend is a strong defense.", | |
"A feather in the hand is better than a bird in the air.", | |
"A fresh start will put you on your way.", | |
"A friend asks only for your time not your money." | |
]; | |
/** | |
* The entry point of the Fortune Cookie Lambda. | |
* | |
* @param {*} event | |
*/ | |
export function fortuneHandler(event) { | |
// returns a random fortune to the request! | |
return fortunes[parseInt(Math.random() * fortunes.length)]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment