var WebSocketServer = require('websocket').server,
    express = require('./express.js');
    
BootstrapServer = function() {};

BootstrapServer.getInstance = function() {
    if (BootstrapServer.__instance == null) {
        BootstrapServer.__instance = new BootstrapServer();
    }
    
    return BootstrapServer.__instance;
};

BootstrapServer.__instance = null;

BootstrapServer.prototype.httpServer = null;
BootstrapServer.prototype.config = {};

BootstrapServer.prototype.bootstrap = function(http, config) {
    var expressApp,
        websocketServer;
    
    this.config = config;
    
    expressApp = this.createExpressApp();
    this.httpServer = http.createServer(expressApp);
    websocketServer = this.createWebsocketServer();
    
    return websocketServer;
};

BootstrapServer.prototype.createExpressApp = function() {
    return express.bootstrap(this.config);
};

BootstrapServer.prototype.createWebsocketServer = function() {
    return new WebSocketServer({
        httpServer: this.httpServer,
        autoAcceptConnections: false
    });
};

BootstrapServer.prototype.run = function() {
    var server = this;
    this.httpServer.listen(this.config.http.port, function() {
        console.log('HTTP Server running with config:');
        console.log(server.config.http);
    });
};

module.exports = BootstrapServer.getInstance();
@@ -406,16 +406,111 @@
 = null;%0A
+BootstrapServer.prototype.websocketServer = null;%0ABootstrapServer.prototype.expressApp = null;%0A
 Bootstra
@@ -608,58 +608,8 @@
 ) %7B%0A
-    var expressApp,%0A        websocketServer;%0A    %0A
     
@@ -642,21 +642,8 @@
 %0A   
- expressApp =
  thi
@@ -704,16 +704,21 @@
 eServer(
+this.
 expressA
@@ -726,16 +726,21 @@
 p);%0A    
+this.
 websocke
@@ -795,16 +795,21 @@
  return 
+this.
 websocke
@@ -883,22 +883,33 @@
 ) %7B%0A    
-return
+this.expressApp =
  express

use class variables instead of local ones