averageComputer/handler.js
// persist the averages to a dynamodb table
persist the averages to a dynamodb table
persist the averages to a dynamodb table
function saveAverages(d) {
  var saveParams = {
    TableName: "Averages",
    Item: {
      "type": "BTC/USD",
      "timestamp": (new Date).getTime(),
      "averages": d
    }
  };
  console.log("saving following: " + JSON.stringify(saveParams));
  return docClient.put(saveParams).promise();
}
function saveAverages ( d ) { var saveParams = { TableName : "Averages" , Item : { "type" : "BTC/USD" , "timestamp" : ( new Date ) . getTime ( ) , "averages" : d } } ; console . log ( "saving following: " + JSON . stringify ( saveParams ) ) ; return docClient . put ( saveParams ) . promise ( ) ; }
persist the averages to a dynamodb table
persist the averages to a dynamodb table