Serve bower components.

    This is meant to be used ONLY by the internal dev server.
    Please configure your web server to handle requests to this URL::

        /bower_components/ => coil/data/bower_components
488329
def serve_bower_components(path):
    
    res = pkg_resources.resource_filename(
        'coil', os.path.join('data', 'bower_components'))
    return send_from_directory(res, path)
1107809
function WebServer(data) {
  // Use a closure to preserve `this`
  var self = this;
  self.data = data;

  this.RequestHandler = bind(this.RequestHandler, this);
  this.callbackExecutor = bind(this.callbackExecutor, this);

  self.server = http.createServer(self.RequestHandler);

  // Use random port if port settings is not provided.
  if (!self.data.port) {
    self.data.port = 0;
  }

  // Use address if provided.
  if (self.data.hostname) {
    self.server.listen(self.data.port, self.data.hostname);
  } else {
    self.server.listen(self.data.port);
  }

  self.server.on('listening', function() {
    self.debug.log('Listen on :%s', self.server.address().port);
  });
}
599323
function serve(argv, skyPagesConfig, webpack, WebpackDevServer) {

  const webpackConfig = require('../config/webpack/serve.webpack.config');
  let config = webpackConfig.getWebpackConfig(argv, skyPagesConfig);

  getPort(config, skyPagesConfig).then(port => {
    const localUrl = `https://localhost:${port}`;

    assetsProcessor.setSkyAssetsLoaderUrl(config, skyPagesConfig, localUrl);
    localeAssetsProcessor.prepareLocaleFiles();

    // Save our found or defined port
    config.devServer.port = port;

    /* istanbul ignore else */
    if (config.devServer.inline) {
      const inline = `webpack-dev-server/client?${localUrl}`;
      Object.keys(config.entry).forEach((entry) => {
        config.entry[entry].unshift(inline);
      });
    }

    if (config.devServer.hot) {
      const hot = `webpack/hot/only-dev-server`;
      Object.keys(config.entry).forEach((entry) => {
        config.entry[entry].unshift(hot);
      });

      // This is required in order to not have HMR requests routed to host.
      config.output.publicPath = `${localUrl}${config.devServer.publicPath}`;
      logger.info('Using hot module replacement.');
    }

    const compiler = webpack(config);
    const server = new WebpackDevServer(compiler, config.devServer);
    server.listen(config.devServer.port, 'localhost', (err) => {
      if (err) {
        logger.error(err);
      }
    });
  }).catch(err => logger.error(err));

}
236676
def serve(self, config, path, route_name=None, permission=None, **view_options):
        
        route_name = route_name or path.replace('/', '.').strip('.')
        path = path.strip('/') + '*traverse'

        self.route_name = route_name
        self.base_permission = permission

        # configure the route and the path
        config.add_route(route_name, path, factory=self.factory)
        config.add_view(
            self.handle_standard_error,
            route_name=route_name,
            renderer='json2',
            context=StandardError
        ),
        config.add_view(
            self.handle_http_error,
            route_name=route_name,
            renderer='json2',
            context=HTTPException
        )
        config.add_view(
            self.process,
            route_name=route_name,
            renderer='json2',
            **view_options
        )
536051
def component_suites(request, resource=None, component=None, extra_element="", **kwargs):
    ''

    get_params = request.GET.urlencode()
    if get_params and False:
        redone_url = "/static/dash/component/%s/%s%s?%s" %(component, extra_element, resource, get_params)
    else:
        redone_url = "/static/dash/component/%s/%s%s" %(component, extra_element, resource)

    return HttpResponseRedirect(redirect_to=redone_url)
806492
public function handleRequest()
    {
        // Create the request very early so the Resource Management has a chance to grab it:
        $this->request = Request::createFromEnvironment();
        $this->response = new Response();

        $this->checkBasicRequirementsAndDisplayLoadingScreen();

        $this->boot();
        $this->resolveDependencies();
        if (isset($this->settings['http']['baseUri'])) {
            $this->request->setBaseUri(new Uri($this->settings['http']['baseUri']));
        }

        $componentContext = new ComponentContext($this->request, $this->response);
        $this->baseComponentChain->handle($componentContext);

        $this->baseComponentChain->getResponse()->send();

        $this->bootstrap->shutdown('Runtime');
        $this->exit->__invoke();
    }
497441
function Server(config) {
  utils.verbose(config.verbose)

  this._wsStarted = false
  this._wsStopped = false

  this._wsConfig = config
  this._wsServer = new websocket.server()

  this._onRequest = config.onRequest

  this._wsServer.addListener("request", this._onRequest)
  this._wsServer.addListener("connect", onConnect)
}
1196511
def app
      # Setup the rack server and adaptor
      RackServerAdaptor.load

      app = Rack::Builder.new

      # Handle websocket connections
      app.use WebsocketHandler

      can_fork = Process.respond_to?(:fork)

      unless can_fork
        Volt.logger.warn('Code reloading in Volt currently depends on `fork`.  Your environment does not support `fork`.  We\'re working on adding more reloading strategies.  For now though you\'ll need to restart the server manually on changes, which sucks.  Feel free to complain to the devs, we really let you down here. :-)')
      end

      # Only run ForkingServer if fork is supported in this env.
      # NO_FORKING can be used to specify that you don't want to use the forking
      # server.
      if !can_fork || Volt.env.production? || Volt.env.test? || ENV['NO_FORKING']
        # In production/test, we boot the app and run the server
        #
        # Sometimes the app is already booted, so we can skip if it is
        boot_volt unless @volt_app

        # Setup the dispatcher (it stays this class during its run)
        SocketConnectionHandler.dispatcher = Dispatcher.new(@volt_app)
        app.run(@volt_app.middleware)
      else
        # In developer
        app.run ForkingServer.new(self)
      end

      app
    end
12045
@Override
    protected void configure() {

        // Bind the vertx and container instances
        bind(vertx).to(Vertx.class);

        // Request and read stream
        bindFactory(VertxRequestReferencingFactory.class).to(HttpServerRequest.class).in(PerLookup.class);
        bindFactory(VertxRequestReferencingFactory.class).to(new TypeLiteral<ReadStream<HttpServerRequest>>() {
        }).in(PerLookup.class);
        bindFactory(ReferencingFactory.<HttpServerRequest>referenceFactory()).to(new TypeLiteral<Ref<HttpServerRequest>>() {
        }).in(RequestScoped.class);

        // Response
        bindFactory(VertxResponseReferencingFactory.class).to(HttpServerResponse.class).in(PerLookup.class);
        bindFactory(ReferencingFactory.<HttpServerResponse>referenceFactory()).to(new TypeLiteral<Ref<HttpServerResponse>>() {
        }).in(RequestScoped.class);

    }
405981
public function handleRequest()
    {
        // Create the request very early so the ResourceManagement has a chance to grab it:
        $request = Request::createFromEnvironment();
        $response = new Response();
        $this->componentContext = new ComponentContext($request, $response);

        $this->boot();
        $this->resolveDependencies();
        $response = $this->addPoweredByHeader($response);
        $this->componentContext->replaceHttpResponse($response);
        $baseUriSetting = $this->bootstrap->getObjectManager()->get(ConfigurationManager::class)->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Neos.Flow.http.baseUri');
        if (!empty($baseUriSetting)) {
            $baseUri = new Uri($baseUriSetting);
            $request = $request->withAttribute(Request::ATTRIBUTE_BASE_URI, $baseUri);
            $this->componentContext->replaceHttpRequest($request);
        }

        $this->baseComponentChain->handle($this->componentContext);
        $response = $this->baseComponentChain->getResponse();

        $response->send();

        $this->bootstrap->shutdown(Bootstrap::RUNLEVEL_RUNTIME);
        $this->exit->__invoke();
    }
1225714
private Server configureJettyServer() {
        LinkedBlockingQueue<Runnable> taskQueue = new LinkedBlockingQueue<Runnable>(m_maxTaskQueue); 
        QueuedThreadPool threadPool = new QueuedThreadPool(m_maxconns, m_defaultMinThreads, m_defaultIdleTimeout, 
        		taskQueue);
        Server server = new Server(threadPool);
        server.setStopAtShutdown(true);
        return server;
    }
381720
def response
      instrument do |data|
        @response ||= Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
          puts as_curl if Yt.configuration.developing?
          http.request http_request
        end
        data[:response] = @response
      end
    rescue *server_errors => e
      raise Yt::ConnectionError, e.message
    end
12495
protected function setHeaderForServer()
    {
        header($this->protocol().' '.$this->getStatusCode().' '.ResponseHeader::$httpStatus[$this->getStatusCode()]);
    }
415806
function( entireComponent ) {

                // Insert a new component holder in the root or box.
                if ( entireComponent ) P.$root.html( createWrappedComponent() )
                else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )

                // Trigger the queued “render” events.
                return P.trigger( 'render' )
            }
1236167
function componentNames(workdir) {
	workdir = workdir || process.cwd();
	try {
		var bowerJson = require(path.join(workdir, 'bower.json'));
		return _(Object.keys(bowerJson.dependencies || {}))
			.union(Object.keys(bowerJson.devDependencies || {}))
			.value();
	} catch (ex) {
		// not found bower
		//console.warn(ex.message);
		return [];
	}
}
548795
private Server setUpServer() {
        Server server = new Server(port);
        ResourceHandler handler = new ResourceHandler();
        handler.setDirectoriesListed(true);
        handler.setWelcomeFiles(new String[]{"index.html"});
        handler.setResourceBase(getReportDirectoryPath().toAbsolutePath().toString());
        HandlerList handlers = new HandlerList();
        handlers.setHandlers(new Handler[]{handler, new DefaultHandler()});
        server.setStopAtShutdown(true);
        server.setHandler(handlers);
        return server;
    }
240911
async function component({repoDir=process.cwd(), outDir=process.cwd()}={}) {
  repoDir = path.isAbsolute(repoDir) ? repoDir : path.resolve(process.cwd(), repoDir);

  outDir = path.isAbsolute(outDir) ? outDir : path.resolve(process.cwd(), outDir);

  const dest = path.resolve(outDir, 'stats.json');

  const promisedData = files.map(filename => {
    console.log(`Reading file: ${repoDir}/${filename}`);
    return loadJsonFile(path.resolve(repoDir, filename));
  });

  promisedData.push(gitTags(repoDir));

  const [package, bower, origami, tags] = await Promise.all(promisedData);

  const statsData = {
    module_name: bower.name,
    keywords: package.keywords,
    repo_home_url: package.homepage,
    is_stable: true,
    tag_name: tags[tags.length-1].tag_name,
    datetime_created: tags[tags.length-1].datetime_created,
    versions: tags,
    has_css: bower.main.indexOf('main.scss') !== -1,
    has_js: bower.main.indexOf('main.js') !== -1,
    dependencies: bower.dependencies,
    description: package.description,
    origami_type: origami.origamiType,
    origami_category: origami.origamiCategory,
    origami_version: origami.origamiVersion,
    support: package.bugs.url,
    support_status: origami.supportStatus,
    brower_features: origami.browserFeatures,
    demos: origami.demos
  };
  console.log(`Generating ${chalk.cyan(dest)}`);
  await writeJsonFile(dest, statsData);
  return statsData;
}