lib/utils/serverfarm.js
function startAppServer(fn) {
  if (!checkingAppServerPort) {
    server = fork(appServer.file, [], appServer.options);
    server.on('exit', code => {
      checkingAppServerPort = false;
      server.removeAllListeners();
      server = null;
      fn(Error('failed to start server'));
    });

    checkingAppServerPort = true;
    waitForPortOpen(appServer.port, fn);
  }
}
function startAppServer(fn) {
  if (!checkingAppServerPort) {
    server = fork(appServer.file, [], appServer.options);
    server.on('exit', code => {
      checkingAppServerPort = false;
      server.removeAllListeners();
      server = null;
      fn(Error('failed to start server'));
    });

    checkingAppServerPort = true;
    waitForPortOpen(appServer.port, fn);
  }
}
function startAppServer ( fn ) { if ( ! checkingAppServerPort ) { server = fork ( appServer . file , [ ] , appServer . options ) ; server . on ( 'exit' , code => { checkingAppServerPort = false ; server . removeAllListeners ( ) ; server = null ; fn ( Error ( 'failed to start server' ) ) ; } ) ; checkingAppServerPort = true ; waitForPortOpen ( appServer . port , fn ) ; } }
Start app server
@param {Function} fn(err)
Start app server