You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
525 B
JavaScript

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