Created
January 29, 2016 23:53
-
-
Save jongacnik/133c0760d0e8e291c83f to your computer and use it in GitHub Desktop.
addEmailLambda.js
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
| 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