public static HttpResponse GetAsset(this EndpointDriver endpoints, AssetFolder folder, string name, string etag = null) { var path = new AssetPath(name, folder); return(endpoints.GetByInput(path, configure: request => { request.Headers.Add(HttpRequestHeader.IfNoneMatch, etag); })); }
private void takeOverFromExistingServer(EmbeddedFubuMvcServer peer, KatanaSettings settings) { _urls = peer.Urls; _services = peer.Services; _server = peer._server; _baseAddress = peer._baseAddress; _endpoints = peer.Endpoints; settings.EmbeddedServer = null; }
public static void Start() { _server = new SelfHostHttpServer(5501, GetRootDirectory()); var runtime = FubuApplication.For<HarnessRegistry>().StructureMap(new Container()).Bootstrap(); _server.Start(runtime); var urls = runtime.Factory.Get<IUrlRegistry>(); urls.As<UrlRegistry>().RootAt(_server.BaseAddress); UrlContext.Stub(_server.BaseAddress); _endpoints = new EndpointDriver(urls); }
public Harness(FubuRuntime runtime, FubuKayakApplication application, string root) { _runtime = runtime; _application = application; var urls = _runtime.Facility.Get <IUrlRegistry>(); urls.As <UrlRegistry>().RootAt(root); UrlContext.Stub(root); _remote = new Lazy <RemoteBehaviorGraph>(() => { return(new RemoteBehaviorGraph(root)); }); _endpoints = new EndpointDriver(urls); }
public static void Start() { _server = new SelfHostHttpServer(5501, GetRootDirectory()); var runtime = FubuApplication.For <HarnessRegistry>().StructureMap(new Container()).Bootstrap(); _server.Start(runtime); var urls = runtime.Factory.Get <IUrlRegistry>(); urls.As <UrlRegistry>().RootAt(_server.BaseAddress); UrlContext.Stub(_server.BaseAddress); _endpoints = new EndpointDriver(urls, _server.BaseAddress); }
public EmbeddedFubuMvcServer(FubuApplication application, string physicalPath = null, int port = 5500) { _application = application; _physicalPath = physicalPath ?? AppDomain.CurrentDomain.BaseDirectory; _server = new SelfHostHttpServer(port, physicalPath); _runtime = _application.Bootstrap(); _server.Start(_runtime); _urls = _runtime.Factory.Get <IUrlRegistry>(); //_urls.As<UrlRegistry>().RootAt(_server.BaseAddress); UrlContext.Stub(_server.BaseAddress); _services = _runtime.Factory.Get <IServiceLocator>(); _endpoints = new EndpointDriver(_urls, _server.BaseAddress); }
public static void Start() { FubuMvcPackageFacility.PhysicalRootPath = GetRootDirectory(); _server = new SelfHostHttpServer(5500, GetRootDirectory()); var runtime = bootstrapRuntime(); _server.Start(runtime); var urls = runtime.Factory.Get <IUrlRegistry>(); urls.As <UrlRegistry>().RootAt(_server.BaseAddress); UrlContext.Stub(_server.BaseAddress); _endpoints = new EndpointDriver(urls); }
public Harness(FubuRuntime runtime, int port) { _runtime = runtime; _server = new SelfHostHttpServer(port, GetApplicationDirectory()); _server.Start(runtime); _port = _server.Port; var urls = _runtime.Factory.Get <IUrlRegistry>(); urls.As <UrlRegistry>().RootAt(_server.BaseAddress); UrlContext.Stub(_server.BaseAddress); _remote = new Lazy <RemoteBehaviorGraph>(() => { return(new RemoteBehaviorGraph(_server.BaseAddress)); }); _endpoints = new EndpointDriver(urls); }
public EmbeddedFubuMvcServer(FubuRuntime runtime, string physicalPath = null, int port = 5500, StartParameters parameters = null) { _runtime = runtime; parameters = parameters ?? new StartParameters(); parameters.Port = port; FubuMvcPackageFacility.PhysicalRootPath = physicalPath ?? AppDomain.CurrentDomain.BaseDirectory; //_server = WebApplication.Start<Starter>(port: port, verbosity: 1); var context = new StartContext { Parameters = parameters, }; var settings = new KatanaSettings { LoaderFactory = () => (s => builder => { var host = new FubuOwinHost(_runtime.Routes); builder.Run(host); }), }; var engine = new KatanaEngine(settings); _server = engine.Start(context); _baseAddress = "http://localhost:" + port; _urls = _runtime.Factory.Get <IUrlRegistry>(); _urls.As <UrlRegistry>().RootAt(_baseAddress); UrlContext.Stub(_baseAddress); _services = _runtime.Factory.Get <IServiceLocator>(); _endpoints = new EndpointDriver(_urls); }
public static void Start() { var rootDirectory = GetRootDirectory(); new FileSystem().DeleteDirectory(rootDirectory.AppendPath(FubuMvcPackageFacility.FubuContentFolder)); _server = new SelfHostHttpServer(5501, rootDirectory); FubuMvcPackageFacility.PhysicalRootPath = rootDirectory; var runtime = FubuApplication.For<HarnessRegistry>().StructureMap(new Container()).Bootstrap(); _server.Start(runtime); var urls = runtime.Factory.Get<IUrlRegistry>(); urls.As<UrlRegistry>().RootAt(_server.BaseAddress); UrlContext.Stub(_server.BaseAddress); _endpoints = new EndpointDriver(urls); }
private void buildEndpointDriver(int port) { _baseAddress = "http://localhost:" + port; UrlContext.Stub(_baseAddress); _endpoints = new EndpointDriver(_urls, _baseAddress); }
public Harness(FubuRuntime runtime, FubuKayakApplication application, string root) { _runtime = runtime; _application = application; var urls = _runtime.Facility.Get<IUrlRegistry>(); urls.As<UrlRegistry>().RootAt(root); UrlContext.Stub(root); _remote = new Lazy<RemoteBehaviorGraph>(() => { return new RemoteBehaviorGraph(root); }); _endpoints = new EndpointDriver(urls); }
public Harness(FubuRuntime runtime, int port) { _runtime = runtime; _server = new SelfHostHttpServer(port, GetApplicationDirectory()); _server.Start(runtime); _port = _server.Port; var urls = _runtime.Factory.Get<IUrlRegistry>(); urls.As<UrlRegistry>().RootAt(_server.BaseAddress); UrlContext.Stub(_server.BaseAddress); _remote = new Lazy<RemoteBehaviorGraph>(() => { return new RemoteBehaviorGraph(_server.BaseAddress); }); _endpoints = new EndpointDriver(urls); }
public static void Start() { FubuMvcPackageFacility.PhysicalRootPath = GetRootDirectory(); _server = new SelfHostHttpServer(5500, GetRootDirectory()); var runtime = bootstrapRuntime(); _server.Start(runtime); var urls = runtime.Factory.Get<IUrlRegistry>(); urls.As<UrlRegistry>().RootAt(_server.BaseAddress); UrlContext.Stub(_server.BaseAddress); _endpoints = new EndpointDriver(urls); }
protected override void beforeLine() { _driver = new EndpointDriver(_urls.Value); _invocation = new EndpointInvocation(); _response = null; }