1
0
mirror of https://github.com/balkian/hookio-sparql-demo.git synced 2024-11-22 03:12:27 +00:00
hookio-sparql-demo/hookio/monkey.js

29 lines
525 B
JavaScript
Raw Normal View History

2012-03-16 22:13:44 +00:00
#!/usr/bin/nodejs
var Hook = require('hook.io').Hook,
express = require('express'),
app = express.createServer(),
io = require('socket.io').listen(app);
app.listen(8008);
io.sockets.on('connection', function (socket) {
socket.emit('news', { hello: 'world' });
socket.on('my other event', function (data) {
console.log(data);
});
});
var monkey = new Hook({
name: "monkey-hook",
debug: true
});
monkey.on('hook::ready', function () {
console.log('I am online :D');
});
monkey.start(1337);