Start bokeh server with applications paths
16032
def create_bokeh_server(io_loop, files, argvs, host, port):
    ''''''
    from bokeh.server.server import Server
    from bokeh.command.util import build_single_handler_applications

    # Turn file paths into bokeh apps
    apps = build_single_handler_applications(files, argvs)

    # kwargs lifted from bokeh serve call to Server, with created io_loop
    kwargs = {
        'io_loop':io_loop,
        'generate_session_ids':True,
        'redirect_root':True,
        'use_x_headers':False,
        'secret_key':None,
        'num_procs':1,
        'host': host,
        'sign_sessions':False,
        'develop':False,
        'port':port,
        'use_index':True
    }
    server = Server(apps,**kwargs)

    return server
1132305
def main():
    ''' 

    '''
    import sys
    from bokeh.command.bootstrap import main as _main

   # Main entry point (see setup.py)
    _main(sys.argv)
1019557
def start
      setup_signal_handlers
      @server = WEBrick::HTTPServer.new(options)
      @server.mount '/', Rack::Handler::WEBrick, app
      @server.start
    end
380207
def setup(app):
    '''  '''
    app.add_config_value('bokeh_gallery_dir', join("docs", "gallery"), 'html')
    app.connect('config-inited', config_inited_handler)
    app.add_directive('bokeh-gallery', BokehGalleryDirective)
1110490
def run(host=DEFAULT_HOST, port=DEFAULT_PORT, path='.'):
    
    path = abspath(path)
    c = Clay(path)
    c.run(host=host, port=port)
908447
function (exec_path, onExec) {

		var onFound = function () {
			
			// if file found, execute directly
			// store starting path
			args.exec_path = exec_path;
			
			LOG.warn('starting ' + size + ' [' + server_type + '] servers', l_name);
			
			// store an entry for the callback when all servers are started as requested
			// TODO: if it takes too long to start all app servers, then force return in some interval
			l_pendingStart.push({
				onDone: onDone,
				total: size,
				curr: 0,
				server_type: server_type,
				servers: []
			});
			
			start_server();
		}
		
		var file_path = SR.path.join(exec_path, args.name, 'frontier.js');
		LOG.warn('validate file_path: ' + file_path, l_name);
		
		// verify frontier file exists, if not then we try package.json
		SR.fs.stat(file_path, function (err, stats) {

			// file not found
			if (err) {
				file_path = SR.path.join(exec_path, 'package.json');
				
				// remove server name from parameter 
				args.name = '';
				
				SR.fs.stat(file_path, function (err, stats) {
					if (err) {
						return onExec('cannot find entry file');
					}
					onFound();
				});
			}
			onFound();
		});
	}
1190827
def start(path, query_parameters = {}, &block)
      if EventMachine.reactor_running?
        connect(path, query_parameters, &block)
      else
        if EventMachine.epoll?
          EventMachine.epoll
        elsif EventMachine.kqueue?
          EventMachine.kqueue
        else
          Kernel.warn('Your OS does not support epoll or kqueue.')
        end

        EventMachine.run do
          connect(path, query_parameters, &block)
        end
      end
    end
310369
def runserver(**config_kwargs):
    
    # force a full reload in sub processes so they load an updated version of code, this must be called only once
    set_start_method('spawn')

    config = Config(**config_kwargs)
    config.import_app_factory()
    loop = asyncio.get_event_loop()

    loop.run_until_complete(check_port_open(config.main_port, loop))

    aux_app = create_auxiliary_app(
        static_path=config.static_path_str,
        static_url=config.static_url,
        livereload=config.livereload,
    )

    main_manager = AppTask(config, loop)
    aux_app.on_startup.append(main_manager.start)
    aux_app.on_shutdown.append(main_manager.close)

    if config.static_path:
        static_manager = LiveReloadTask(config.static_path, loop)
        logger.debug('starting livereload to watch %s', config.static_path_str)
        aux_app.on_startup.append(static_manager.start)
        aux_app.on_shutdown.append(static_manager.close)

    url = 'http://{0.host}:{0.aux_port}'.format(config)
    logger.info('Starting aux server at %s ◆', url)

    if config.static_path:
        rel_path = config.static_path.relative_to(os.getcwd())
        logger.info('serving static files from ./%s/ at %s%s', rel_path, url, config.static_url)

    return aux_app, config.aux_port, loop, AuxAccessLogger
39835
def start_msstitch(exec_drivers, sysargs):
    """"""
    parser = populate_parser(exec_drivers)
    args = parser.parse_args(sysargs[1:])
    args.func(**vars(args))
644968
def show_help(bokehjs_action):
    ''' 

    '''
    print()
    if bokehjs_action in ['built', 'installed']:
        print("Bokeh-specific options available with 'install' or 'develop':")
        print()
        print("  --build-js          build and install a fresh BokehJS")
        print("  --install-js        install only last previously built BokehJS")
    else:
        print("Bokeh is using PACKAGED BokehJS, located in 'bokeh.server.static'")
        print()
        print("No extra Bokeh-specific options are available.")
    print()
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
    );
  }
222009
def start(self):
        
        plugins = voltron.plugin.pm.web_plugins
        self.app = DispatcherMiddleware(
            RootFlaskApp(),
            {
                "/api": APIFlaskApp(server=self),
                "/view": SharedDataMiddleware(
                    None,
                    {'/{}'.format(n): os.path.join(p._dir, 'static') for (n, p) in six.iteritems(plugins)}
                ),
                "/ui": ui_app
            }
        )

        def run_listener(name, cls, arg):
            # with pysigset.suspended_signals(signal.SIGCHLD):
            log.debug("Starting listener for {} socket on {}".format(name, str(arg)))
            s = cls(*arg)
            t = threading.Thread(target=s.serve_forever)
            t.daemon = True
            t.start()
            self.threads.append(t)
            self.listeners.append(s)

        if voltron.config.server.listen.tcp:
            run_listener('tcp', ThreadedVoltronWSGIServer, list(voltron.config.server.listen.tcp) + [self.app])

        if voltron.config.server.listen.domain and sys.platform != 'win32':
            path = os.path.expanduser(str(voltron.config.server.listen.domain))
            try:
                os.unlink(path)
            except:
                pass
            run_listener('domain', ThreadedUnixWSGIServer, [path, self.app])

        self.is_running = True
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);

}
163218
def start(self, app):
        
        app.middlewares.insert(0, debugtoolbar_middleware_factory)
        self.global_panels = [Panel(self.app) for Panel in self.cfg.global_panels]
1231428
function start(object, filename) {
  var port = process.env.PORT || argv.port
  var hostname = argv.host === '0.0.0.0' ? 'localhost' : argv.host

  for (var prop in object) {
    console.log(chalk.gray('  http://' + hostname +  ':' + port + '/') + chalk.cyan(prop))
  }

  console.log(
    '\nYou can now go to ' + chalk.gray('http://' + hostname + ':' + port + '/\n')
  )

  console.log(
    'Enter ' + chalk.cyan('`s`') + ' at any time to create a snapshot of the db\n'
  )

  process.stdin.resume()
  process.stdin.setEncoding('utf8')
  process.stdin.on('data', function (chunk) {
    if (chunk.trim().toLowerCase() === 's') {
      var file = 'db-' + Date.now() + '.json'
      _db.save(object, file)
      console.log('\nSaved snapshot to ' + chalk.cyan(file) + '\n')
    }
  })

  if (filename) {
    var router = jsonServer.router(filename)
  } else {
    var router = jsonServer.router(object)
  }

  var server = jsonServer.create()
  server.use(jsonServer.defaults)
  server.use(router)
  server.listen(port, argv.host)
}
234906
def start

      # prepare config
      config = {}
      begin
        config = YAML::load_file(CONFIG_FILE)
      rescue Exception => e
        load 'lib/cogbot/setup.rb'
        config['main'] = Cogbot::Setup.init
      end

      # prepare daemon
      Daemons.daemonize(
        :app_name => 'cogbot',
        :dir_mode => :normal,
        :log_dir => LOG_DIR,
        :log_output => true,
        :dir => CONFIG_DIR
      )

      # checkout plugins
      plugins = []
      config['main']['plugins'].each do |p|
        if File.exists?(File.join(ROOT_DIR, 'plugins', "#{p}.rb"))
          require File.join(ROOT_DIR, 'plugins', p)
          plugins.push Cinch::Plugins.const_get(p.camelize)
        end
      end

      # create bot
      bot = Cinch::Bot.new do
        configure do |c|
          c.server = config['main']['server']
          c.ssl.use = ( config['main']['ssl'] == 'true' )
          c.nick = config['main']['nick']
          c.user = config['main']['nick']
          c.realname = config['main']['nick']
          c.channels = config['main']['channels']
          c.sasl.username = config['main']['sasl_user']
          c.sasl.password = config['main']['sasl_pass']
          c.options = { 'cogconf' => config }
          c.plugins.prefix = config['main']['prefix']
          c.plugins.plugins = plugins
        end
        on :message, 'hi' do |m|
          m.reply "Hello, #{m.user.nick}"
        end
      end
      bot.loggers.debug(plugins.inspect)

      Signal.trap('TERM') { EM.stop }

      EM.run do
        EM.defer { bot.start }
        if config['server']
          EM.add_timer(3) do
            EM.start_server(
              config['server']['ip'],
              config['server']['port'],
              Server,
              bot
            )
          end
        end
      end

      bot.quit
    end
263726
def main():
    
    try:
        # Get the `src` directory's absolute path
        src_path = os.path.dirname(
            # `aoiklivereload` directory's absolute path
            os.path.dirname(
                # `demo` directory's absolute path
                os.path.dirname(
                    # This file's absolute path
                    os.path.abspath(__file__)
                )
            )
        )

        # If the `src` directory path is not in `sys.path`
        if src_path not in sys.path:
            # Add to `sys.path`.
            #
            # This aims to save user setting PYTHONPATH when running this demo.
            #
            sys.path.append(src_path)

        # Import reloader class
        from aoiklivereload import LiveReloader

        # Create reloader
        reloader = LiveReloader()

        # Start watcher thread
        reloader.start_watcher_thread()

        # Server host
        server_host = '0.0.0.0'

        # Server port
        server_port = 8000

        # Get message
        msg = '# ----- Run server -----\nHost: {}\nPort: {}'.format(
            server_host, server_port
        )

        # Print message
        print(msg)

        # Create Flask app
        flask_app = flask.Flask(__name__)

        # Create request handler
        @flask_app.route('/')
        def hello_handler():  # pylint: disable=unused-variable
            """
            Request handler.

            :return:
                Response body.
            """
            # Return response body
            return 'hello'

        # Run server
        flask_app.run(
            host=server_host,
            port=server_port,
            # Disable Flask's reloader
            debug=False,
        )

    # If have `KeyboardInterrupt`
    except KeyboardInterrupt:
        # Not treat as error
        pass