forked from pubnub/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmigration.js
More file actions
52 lines (41 loc) · 1.04 KB
/
migration.js
File metadata and controls
52 lines (41 loc) · 1.04 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* ---------------------------------------------------------------------------
Init PubNub and Get your PubNub API Keys:
http://www.pubnub.com/account#api-keys
--------------------------------------------------------------------------- */
function logResults(r){
console.log("RESULT from " + r.operation + " call:");
console.log(JSON.stringify(r,null,2));
}
function logStatus(r){
console.log("STATUS from " + r.operation + " call:");
console.log(JSON.stringify(r,null,2));
}
var pubnub = require("./../pubnub.js").init({
publish_key : "demo-36",
subscribe_key : "demo-36",
secret_key : "demo-36",
ssl : true,
uuid : "v4_migration",
result : logResults,
status : logStatus
});
var channel = "a";
var message = "Hello World !!!"
pubnub.subscribe({
channel: channel}
);
pubnub.history({
channel : channel
});
pubnub.publish({
channel : channel,
message : message
});
pubnub.grant({
channel: channel,
read : true,
write : true
});
pubnub.audit({
channel: channel
});