Created
June 21, 2018 06:17
-
-
Save koladilip/e30f5d688b5e70c15f50274a5f0c7ebc to your computer and use it in GitHub Desktop.
This Lambda code example is for https://medium.com/tensult/make-a-website-dynamic-using-apis-f5d07def5d77
This file contains 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
'use strict'; | |
const AWS = require("aws-sdk"); | |
const dynamo = new AWS.DynamoDB.DocumentClient(); | |
exports.handler = (event, context, callback) => { | |
const contactInfo = {}; | |
contactInfo.Item = { | |
"email": event.email, | |
"name": event.name, | |
"message": event.message | |
}; | |
contactInfo.TableName = "mywebsite-contact-us"; | |
dynamo.put(contactInfo, callback); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment