start web server
968866
def start(path=None, host=None, port=None, color=None, cors=None, detach=False, nolog=False):
    """"""
    if detach:
        sys.argv.append('--no-log')
        idx = sys.argv.index('-d')
        del sys.argv[idx]
        cmd = sys.executable + ' ' + ' '.join([sys.argv[0], 'start'] + sys.argv[1:])
        if os.name == 'nt':
            cmd = 'start /B %s' % cmd
        else:
            cmd = '%s &' % cmd
        os.system(cmd)
    else:    
        if path:
            path = os.path.abspath(path)
        app.config['PATH_HTML']= first_value(path, app.config.get('PATH_HTML',None), os.getcwd())
        app.config['HOST'] = first_value(host, app.config.get('HOST',None), '0.0.0.0')
        app.config['PORT'] = int(first_value(port, app.config.get('PORT',None), 5001))
        app.logger.setLevel(logging.DEBUG)
        app.config['historylog'] = HistoryHandler()
        app.logger.addHandler(app.config['historylog'])
        if not nolog:
            app.logger.addHandler(StreamHandler())
        if cors: CORS(app)
        app.run(host = app.config['HOST'],
                port = app.config['PORT'],
                threaded = True)
202648
def start_server(self, addr='', port=8000):
        
        if self._multiprocess_on:
            raise SanicPrometheusError(
                "start_server can not be used when multiprocessing " +
                "is turned on")
        start_http_server(addr=addr, port=port)
491262
function start (settings) {

  settings = settings || {};

  // Populate security values with the corresponding files.
  if (settings.secure) {
    settings.passphrase = settings.passphrase || '1234';
    settings.key = settings.key || 'https.key';
    settings.cert = settings.cert || 'https.crt';
    settings.ca = settings.ca || [];
  }

  settings.port = settings.port || (settings.secure ? 443 : 80);

  return startServer(settings);
}
787116
function startServer() {
    this._flo = flo(
      // The path to watch (see `setOptions(…)`).
      this.config.publicPath,
      // The config-provided fb-flo options + a generic watch glob
      // (all JS/CSS, at any depth) inside the watched path.
      extend(
        pick(this.config, FB_FLO_OPTIONS),
        { glob: ['**/*.js', '**/*.css'] }
      ),
      // Our resolver method (it was properly bound upon construction).
      this.resolver
    );
  }
1316131
def Start(self):
    """"""
    try:
      self._http_server = http_server.HTTPServer(("", self.port),
                                                 StatsServerHandler)
    except socket.error as e:
      if e.errno == errno.EADDRINUSE:
        raise base_stats_server.PortInUseError(self.port)
      else:
        raise

    self._server_thread = threading.Thread(
        target=self._http_server.serve_forever)
    self._server_thread.daemon = True
    self._server_thread.start()
379805
public function start()
  {
    try
    {
        $host    = $this->getOption('host');
        $port    = intval($this->getOption('port'));
        $binary  = ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));
        $docroot = ProcessUtils::escapeArgument($this->getOption('docroot'));
        $output  = $this->output;

        $this->writeln([
          sprintf('Codeigniter development server started at %s', date(DATE_RFC2822)),
          sprintf('Listening on http://%s:%s', $host, $port),
          sprintf('Document root is %s', getcwd()),
          'Press Ctrl-C to quit.'
        ]);

        $process = new Process(sprintf('%s -S %s:%s -t %s', $binary, $host, $port, $docroot));

        $process
            // ->setWorkingDirectory(getcwd())
            ->setTimeout(0)
            ->setPTY(true)
            ->run(function ($type, $buffer) use($output) {
                if (Process::ERR === $type && $output instanceof ConsoleOutputInterface) {
                    $output = $output->getErrorOutput();
                }
                $output->write($buffer, false, OutputInterface::OUTPUT_RAW);
            });
    }
    catch (Exception $e)
    {
        $this->error(sprintf(
            'Error starting the server: %s', $e->getMessage()
        ));
    }
  }
639257
protected function start()
    {
        if ($this->isRunning($this->getCurrentPid())) {
            $this->error('Failed! swoole_http_server process is already running.');

            return;
        }

        $host = Arr::get($this->config, 'server.host');
        $port = Arr::get($this->config, 'server.port');
        $hotReloadEnabled = Arr::get($this->config, 'hot_reload.enabled');
        $accessLogEnabled = Arr::get($this->config, 'server.access_log');

        $this->info('Starting swoole http server...');
        $this->info("Swoole http server started: <http://{$host}:{$port}>");
        if ($this->isDaemon()) {
            $this->info(
                '> (You can run this command to ensure the ' .
                'swoole_http_server process is running: ps aux|grep "swoole")'
            );
        }

        $manager = $this->laravel->make(Manager::class);
        $server = $this->laravel->make(Server::class);

        if ($accessLogEnabled) {
            $this->registerAccessLog();
        }

        if ($hotReloadEnabled) {
            $manager->addProcess($this->getHotReloadProcess($server));
        }

        $manager->run();
    }
939670
def start_http_server(self, port, args):
        
        # Start the HTTP Server
        LOGGER.info("Starting Tornado v%s HTTPServer on port %i Args: %r",
                    tornado_version, port, args)
        http_server = httpserver.HTTPServer(self.app, **args)
        http_server.bind(port, family=socket.AF_INET)
        http_server.start(1)
        return http_server
526265
def start(self):
        """"""
        msg = ''
        if not self.running():
            if self._port == 0:
                self._port = _port_not_in_use()
            self._process = start_server_background(self._port)
        else:
            msg = 'Server already started\n'
        msg += 'Server running at {}'.format(self.url())
        print(msg)
1019557
def start
      setup_signal_handlers
      @server = WEBrick::HTTPServer.new(options)
      @server.mount '/', Rack::Handler::WEBrick, app
      @server.start
    end
451073
public void startServer() {

    server = new Server(httpPort);
    server.setHandler(wrapHandlers());

    if (isWebSocketInClassPath()) {
      setupForWebSocket();
    }
    try {
      server.start();
      log().info("server started");

      Runtime.getRuntime().addShutdownHook(new Thread(new ShutdownRunnable()));
      
      if (useStdInShutdown) {
        // generally for use in IDE via JettyRun, Use CTRL-D in IDE console to shutdown
        BufferedReader systemIn = new BufferedReader(new InputStreamReader(System.in, "UTF-8"));
        while((systemIn.readLine()) != null) {
          // ignore anything except CTRL-D by itself
        }
        System.out.println("Shutdown via CTRL-D");
        System.exit(0);
      }

    } catch (Exception e) {
      e.printStackTrace();
      System.exit(100);
    }
  }
844330
@Override
    public void start() {
        String res = launchPing();
        if (res != null && res.length() > 0) {
            res = res.toLowerCase();
            if (res.contains(Cmd.PING_UNREACHABLE) && !res.contains(Cmd.PING_EXCEED)) {
                // Failed
                mLossRate = 1f;
                mError = Cmd.HOST_UNREACHABLE_ERROR;
            } else {
                // Succeed
                mLossRate = parseLoss(res);
                mDelay = parseDelay(res);
                if (isAnalysisIp)
                    mIp = parseIp(res);
            }
        } else {
            mError = Cmd.DROP_DATA_ERROR;
        }
    }
1337643
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);
  }
}
25773
def start(name, call=None):
    '''
    
    '''
    datacenter_id = get_datacenter_id()
    conn = get_conn()
    node = get_node(conn, name)

    conn.start_server(datacenter_id=datacenter_id, server_id=node['id'])

    return True
576876
async def start_server_in_loop(runner, hostname, port, agent):
    
    await runner.setup()
    agent.web.server = aioweb.TCPSite(runner, hostname, port)
    await agent.web.server.start()
    logger.info(f"Serving on http://{hostname}:{port}/")
596306
function startServer() {
    var defer = q.defer();

    var serverConfig = {
        server: {
            baseDir: wpath,
            directory: true
        },
        startPath: 'docs/index.html',
        // browser: "google chrome",
        logPrefix: 'SERVER'
    };
    browserSync.init(serverConfig, defer.resolve);

    return defer.promise;
}
495065
function startBrowserSync(serverRoot) {

    console.log('Starting BrowserSync on port ' + 8010 + ' for ' + serverRoot);

    var options = {
        //proxy: 'localhost:' + port,
        port: 8010,
        ws: true,
        server: {
            baseDir: serverRoot
        },
        reloadDelay: 2000
    };

    browserSync.init(options);

}