1
0
mirror of https://github.com/balkian/Web4.0.git synced 2024-09-28 16:11:43 +00:00
Web4.0/hookio/monkey.js
J.Fernando Sánchez c54ae367be Deleted submodules
2012-03-15 14:28:37 +01:00

29 lines
525 B
JavaScript
Executable File

#!/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);