lib/ishiki.js
function startDrone(pkg, userid, appid, callback) {
    var drone_port = getPort();

    if (drone_port) {
      pkg.env = pkg.env || {};
      pkg.env['PORT'] = drone_port;

      //ensure package user and name match internally
      pkg.user = userid;
      pkg.name = appid;

      drone.start(pkg, function(err, result) {
        if (err)
          callback(err);

        pkg.host = result.host;
        pkg.port = result.port;
        pkg.uid = result.uid;

        //async update package in db
        droneModel.createOrUpdate(pkg, function(){});

        //load proxy routes
        proxy.load(app.config.get('public-port'), pkg);

        callback(null, {drone: result});
      });
    }else{
      callback({message: 'No more ports available'});
    }
  }
function startDrone(pkg, userid, appid, callback) {
    var drone_port = getPort();

    if (drone_port) {
      pkg.env = pkg.env || {};
      pkg.env['PORT'] = drone_port;

      //ensure package user and name match internally
      pkg.user = userid;
      pkg.name = appid;

      drone.start(pkg, function(err, result) {
        if (err)
          callback(err);

        pkg.host = result.host;
        pkg.port = result.port;
        pkg.uid = result.uid;

        //async update package in db
        droneModel.createOrUpdate(pkg, function(){});

        //load proxy routes
        proxy.load(app.config.get('public-port'), pkg);

        callback(null, {drone: result});
      });
    }else{
      callback({message: 'No more ports available'});
    }
  }
function startDrone ( pkg , userid , appid , callback ) { var drone_port = getPort ( ) ; if ( drone_port ) { pkg . env = pkg . env || { } ; pkg . env [ 'PORT' ] = drone_port ; //ensure package user and name match internally pkg . user = userid ; pkg . name = appid ; drone . start ( pkg , function ( err , result ) { if ( err ) callback ( err ) ; pkg . host = result . host ; pkg . port = result . port ; pkg . uid = result . uid ; //async update package in db droneModel . createOrUpdate ( pkg , function ( ) { } ) ; //load proxy routes proxy . load ( app . config . get ( 'public-port' ) , pkg ) ; callback ( null , { drone : result } ) ; } ) ; } else { callback ( { message : 'No more ports available' } ) ; } }
starts a drone and sets up proxy routes for it
starts a drone and sets up proxy routes for it