-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
43 lines (35 loc) · 1.5 KB
/
index.html
File metadata and controls
43 lines (35 loc) · 1.5 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
<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p>My first paragraph.</p>
<button class="btn btn-large btn-primary" type="button" id="send"> Send Message </button>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="bastly.js"></script>
<script>
var bastly = bastly({
from: 'webclient',
apiKey: "7b6696d0-0d4a-11e5-8f7e-095df2532ac5",
// connector: '192.168.1.234',
// curaca: '192.168.1.236',
opsCallback: function (error, data) {
console.log("got an ops response " + error + data);
},
callback: function (data) {
console.log("got a channel msg" + data);
}
});
bastly.subscribe('webclient', function messageCb (data){
console.log('Msg recived---------------------------', data);
}, function finishedSubscription (error, data){
console.log("sending messages ////////////////" + error);
});
$( "#send" ).click(function() {
bastly.send('webclient', {me : 'hi'});
// bastly.send("webclient", {spell: "fireball", material: "fire", strength: "12"});
});
</script>
</body>
</html>