theroom
v1.0.5
Published
theRoom service bridge
Downloads
14
Readme
theRoom service bridge
Install
$ npm install theroom
Usage
var TheRoom = require('theroom').theRoom;
var config = {
"serverURL":"http://e-nodehost.ru:1337",
"applicationId":"myAppId",
"roomId":"s18LmTlmA8",
"proxy":"http://userId:[email protected]:9090"
};
var theRoom = new TheRoom(config);
var mdcontent = '#chart test\r\n\
\r\n\
~[discreteBarChart:{title:"test",xlabel:"sdkjf",ylabel:"sfdjsdhf",data:[12.2,34,234,234,324,53,45,65,645,45,45,23,44,54]}]~';
theRoom.login("Robo1","Robo1", function (err){
if (err) {
console.log ("error", err);
return;
}
theRoom.joinRoom(config.roomId,function(err){
if (err){
console.log ("Server error:", err);
return;
}
theRoom.registerAction("test1", { action:"chatMessage", params:[undefined,'test message'], users:undefined, title:"test3", description:"test 3 test 3 test 3" },
function(){
console.log ("call back of registerAction");
});
try{
if (!err){
setTimeout(function(){
console.log ("send msg");
theRoom.sendMessage(config.roomId, {
content:{
options: mdcontent
}
});
},1000);
}
}
catch(ex){
console.log (ex);
}
});
})
theRoom.on("chatMessage", function(ev,data){
console.log (ev,data);
});
License
MIT © Sindre Sorhus