Skip to content

Instantly share code, notes, and snippets.

View jparreira's full-sized avatar

João Parreira jparreira

View GitHub Profile
@jparreira
jparreira / iot_to_realtime.js
Last active December 14, 2015 12:35
AWS Lambda function that send a message through the Realtime Messaging Platform
var https = require('https');
exports.handler = function(event, context) {
var appkey = 'YOUR_REALTIME_APPKEY';
var privatekey = 'YOUR_REALTIME_PRIVATEKEY';
var channel = 'aws-iot';
var message = JSON.stringify(event);
var postBody = "AK=" + appkey + "&PK=" + privatekey + "&C=" + channel + "&M=" + message;
var headers = {