lib/npm_crafty.server.js
function(immediateFN, connectFN, disconnectFN, port) {
	var app = require('express')(),
		server = require('http').createServer(app),
		io = require('socket.io').listen(server),
		path = require('path'),
		browserify = require('browserify-middleware');

	io.set('log level', 2);
	server.listen(port || process.env.PORT || 80);


	var browserifyOptions = {};
	browserifyOptions[path.join(__dirname + '/npm_crafty.client.js')] = {expose: 'npm_crafty'};
	app.get('/npm_crafty.js', browserify([browserifyOptions]));

	app.get('/crafty_client.js', function (req, res) {
		res.sendfile(path.join(__dirname + '/crafty_client.js'));
	});
	

	io.sockets.on('connection', function (socket) {
		console.log("Connected ", socket.id);
		connectFN(socket);
		
		socket.on('disconnect', function (arg) {
			console.log("Disconnected ", socket.id);
			disconnectFN(socket);
		});
	});
	process.nextTick(immediateFN);

	var _server = new Server(io.sockets);
	_server.app = app;
	_server.server = server;
	_server.io = io;
	return _server;
}
function(immediateFN, connectFN, disconnectFN, port) {
	var app = require('express')(),
		server = require('http').createServer(app),
		io = require('socket.io').listen(server),
		path = require('path'),
		browserify = require('browserify-middleware');

	io.set('log level', 2);
	server.listen(port || process.env.PORT || 80);


	var browserifyOptions = {};
	browserifyOptions[path.join(__dirname + '/npm_crafty.client.js')] = {expose: 'npm_crafty'};
	app.get('/npm_crafty.js', browserify([browserifyOptions]));

	app.get('/crafty_client.js', function (req, res) {
		res.sendfile(path.join(__dirname + '/crafty_client.js'));
	});
	

	io.sockets.on('connection', function (socket) {
		console.log("Connected ", socket.id);
		connectFN(socket);
		
		socket.on('disconnect', function (arg) {
			console.log("Disconnected ", socket.id);
			disconnectFN(socket);
		});
	});
	process.nextTick(immediateFN);

	var _server = new Server(io.sockets);
	_server.app = app;
	_server.server = server;
	_server.io = io;
	return _server;
}
Setup a default node server, which will serve npm_crafty's required files (it will reply to GET requests). <br />
Each callback will be called at the appropriate times.
Communication will be set to the default <code>'/'</code> namespace.

@memberof module:"npm_crafty.server"~Server
@param {!function()} immediateFN - will be called immediately once all libraries are loaded
@param {!module:"npm_crafty.net"#SocketCallback} connectFN - will be called when a client connects to the server
@param {!module:"npm_crafty.net"#SocketCallback} disconnectFN - will be called when a client disconnects from the server
@param {number} [port=80] - the port to use (defaults to <code>process.env.PORT</code>; falls back to standard HTTP port <code>80</code>)
@returns {!module:"npm_crafty.server"~Server} - the ServerAPI object, which in addition to the available methods also contains the <code>app</code>, <code>server</code> and <code>io</code> property

@example
var Crafty;
var Server = require('npm_crafty').setupDefault( function () { //immediate callback
Crafty = Server.createInstance("Room1");
}, function (socket) { //connect callback
Server.addClient(Crafty, socket);
}, function (socket) { //disconnect callback
});