forked from pubnub/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.js
More file actions
27 lines (21 loc) · 674 Bytes
/
hello.js
File metadata and controls
27 lines (21 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* ---------------------------------------------------------------------------
Init PubNub and Get your PubNub API Keys:
http://www.pubnub.com/account#api-keys
--------------------------------------------------------------------------- */
var PUBNUB = require("../pubnub.js")
var pubnub = PUBNUB({
publish_key : "demo",
subscribe_key : "demo"
//cipher_key : "demo"
});
pubnub.publish({
post: false,
channel : 'PubNubTest_RX',
message : { 'test' : 'f?ds' },
callback : function(details) {
var success = details[0]
, response = details[1];
if (success) console.log( "Success!", response );
if (!success) console.log( "Fail!", response );
}
});