luigi

Quick and easy class for defining your plumbing with express.io for HTTP and Socket IO.

  • luigi

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
luigi
000.0.111 years ago11 years agoMinified + gzip package size for luigi in KB

Readme

luigi
Quick and easy class for defining your plumbing with express.io for HTTP and Socket IO.
Usage
var luigi = require('luigi');
luigi.plumbing({
port: 10000,
http: {
	get: {
		'/' : function (q,r) {
			return r.send('<!doctype html><html><script src=\'socket.io/socket.io.js\'></script></html>');
		},
		'/echo' : function (q,r) {
			return r.send({
				echo : 'GET /echo'
			});
		}
	},
	post: {
		'/echo' : function (q,r) {
			return r.send({
				echo : 'POST /echo'
			});
		}
	}
},
socket: {
	'unicast:echo' : function (q) {
		return q.io.emit('unicast:echo','unicast:echo');
	},
	'broadcast:echo' : function (q) {
		return q.io.broadcast('broadcast:echo','broadcast:echo');
	}
}
});