Code coverage report for lib/index.js

Statements: 100% (14 / 14)      Branches: 83.33% (5 / 6)      Functions: 100% (3 / 3)      Lines: 100% (14 / 14)      Ignored: none     

All files » lib/ » index.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 271 1 1   13 9 9   13 12 12 12 6       1   13       1        
var Server = require('./server').Server;
var Frame = require('./frame').Frame;
module.exports = exports = {
  createServer : function(http, options, cb) {
    if (typeof options === 'function') {
      cb = options;
      options = null;
    }
    if (!http.__QWS_SERVER) {
      http.__QWS_SERVER = new Server(http, options, cb);
      Eif (typeof cb === 'function') {
        http.__QWS_SERVER.on('connect', function(msg){
          msg.on('message', msg.__QWS_CB);
        });
      }
    } else {
      http.__QWS_SERVER.addServer(options, cb);
    }
    return http.__QWS_SERVER;
  },
  Server : Server,
  createFrame : function(props) {
    return new Frame(props);
  },
  Frame : Frame
};