Exemple #1
0
        private void startAtPort(FubuRuntime runtime)
        {
            _baseAddress   = "http://localhost:" + _port;
            _configuration = new HttpSelfHostConfiguration(_baseAddress);

            FubuMvcPackageFacility.PhysicalRootPath = _rootDirectory;

            _selfHostHttpMessageHandler = new SelfHostHttpMessageHandler(runtime)
            {
                Verbose = Verbose
            };

            _server = new HttpSelfHostServer(_configuration, _selfHostHttpMessageHandler);

            runtime.Facility.Register(typeof(HttpSelfHostConfiguration), ObjectDef.ForValue(_configuration));

            Console.WriteLine("Starting to listen for requests at " + _configuration.BaseAddress);

            _server.OpenAsync().Wait();
        }
        private void startAtPort(string rootDirectory, FubuRuntime runtime)
        {
            _baseAddress = "http://localhost:" + _port;
            _configuration = new HttpSelfHostConfiguration(_baseAddress);

            FubuMvcPackageFacility.PhysicalRootPath = rootDirectory;

            _selfHostHttpMessageHandler = new SelfHostHttpMessageHandler(runtime)
            {
                Verbose = Verbose
            };

            _server = new HttpSelfHostServer(_configuration, _selfHostHttpMessageHandler);

            runtime.Facility.Register(typeof (HttpSelfHostConfiguration), ObjectDef.ForValue(_configuration));

            Console.WriteLine("Starting to listen for requests at " + _configuration.BaseAddress);

            _server.OpenAsync().Wait();
        }