Skip to content

Instantly share code, notes, and snippets.

@adnanrahic
Created May 31, 2018 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adnanrahic/4ee0c90dcd1c996a740c9c4877ca0805 to your computer and use it in GitHub Desktop.
Save adnanrahic/4ee0c90dcd1c996a740c9c4877ca0805 to your computer and use it in GitHub Desktop.
const moment = require('moment');
exports.handler = async (event) => {
const min = 1;
const max = 6;
const randomNumber = Math.floor(Math.random() * (max - min + 1)) + min;
const now = moment().format();
const message = 'Your dice throw resulted in ' +
randomNumber + ' and was issued at ' + now;
return message;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment