Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. // Basic blueprint of a lambda function
  2.  
  3. 'use strict'
  4. console.log('Loading function');
  5.  
  6. exports.handler = (event, context, callback) => {
  7. callback(null, event.key1); // callback takes two parameters 1. error 2. a success message (string or obj that can be stringify to return to the user)
  8. }
  9.  
  10. // Simple example
  11.  
  12. 'use strict'
  13. console.log('Loading function');
  14.  
  15. exports.handler = (event, context, callback) => {
  16. let min = 0;
  17. let max = 10;
  18. let generatedNumber = Math.floor(Math.random() * max) + min;
  19.  
  20. callback(null, generatedNumber);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement