Skip to content

Instantly share code, notes, and snippets.

View Neolusis's full-sized avatar

Neolusis

View GitHub Profile
var aws = require('aws-sdk');
var iotData = new aws.IotData({endpoint: 'A3D97TFWGXY29V.iot.us-west-2.amazonaws.com'});
exports.handler = function(event, context) {
var params = {
"topic": "sigfox/datatopic",
"payload": "device: "+event.device+" temperature: "+event.temperature+" humidity: "+event.humidity+" time: "+event.time
}
;
console.log('Loading event');
var AWS = require('aws-sdk');
var dynamodb = new AWS.DynamoDB();
exports.handler = function(event, context) {
console.log("Request received:\n", JSON.stringify(event));
console.log("Context received:\n", JSON.stringify(context));
var tableName = "SigfoxStore";
var datetime = new Date().getTime().toString();