Skip to content

Instantly share code, notes, and snippets.

@paulopatto
Last active April 19, 2017 06:56
Show Gist options
  • Save paulopatto/27d3afea4d44de38f4ac70959685bc0b to your computer and use it in GitHub Desktop.
Save paulopatto/27d3afea4d44de38f4ac70959685bc0b to your computer and use it in GitHub Desktop.
'use strict';
console.log('Loading function');
exports.handler = (event, context, callback) => { callback(null, event); };
'use strict';
console.log('Starting FaaS:fn ');
exports.handler = (event, context, callback) => {
const MIN_VALUE = 0;
const MAX_VALUE = 10;
const generatedNumber = Math.floor( Math.random() * MAX_VALUE ) + MIN_VALUE;
/**
* fn:callback -> $err , $succ
*
* $err => error message
* $succ => success return
*/
callback( null, generatedNumber );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment