Skip to content

Instantly share code, notes, and snippets.

@jongacnik
Created January 29, 2016 23:53
Show Gist options
  • Select an option

  • Save jongacnik/133c0760d0e8e291c83f to your computer and use it in GitHub Desktop.

Select an option

Save jongacnik/133c0760d0e8e291c83f to your computer and use it in GitHub Desktop.
addEmailLambda.js
var doc = require('dynamodb-doc')
var dynamo = new doc.DynamoDB()
exports.handler = function (event, context) {
var params = {
"TableName": "SignupTable",
"Item": {
"type": "email",
"email": event.email,
"date": new Date().toISOString()
}
}
dynamo.putItem(params, function (err,data) {
console.log(err)
console.log('Stored email ' + email)
context.succeed('Stored email: ' + email)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment