Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 26 lines (21 sloc) 679 Bytes
#!/usr/bin/env node
//
// name : holler-server.js
// description : Starts a Faye server for notifications
//
// make sure we have only one arg
if(process.argv.length>3){
console.error("usage: holler-server [port]");
process.exit();
}
// define our ish
// TODO: definitely handle this better using something
// like https://github.com/substack/node-optimist
var port = process.argv.length==3 ? process.argv[2] : 1337,
http = require('http'),
faye = require('faye');
// start listening
var bayeux = new faye.NodeAdapter({mount: '/faye', timeout: 45});
bayeux.listen(port);
// let everyone know we're ready
console.log("ready to holler on port "+port);