Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Browser"/> class.
 /// </summary>
 /// <param name="bootstrapper">A <see cref="INancyBootstrapper"/> instance that determines the Nancy configuration that should be used by the browser.</param>
 /// <param name="defaults">The default <see cref="BrowserContext"/> that should be used in a all requests through this browser object.</param>
 public Browser(INancyBootstrapper bootstrapper, Action<BrowserContext> defaults = null)
 {
     bootstrapper.Initialise();
     this.engine = bootstrapper.GetEngine();
     this.environment = bootstrapper.GetEnvironment();
     this.defaultBrowserContext = defaults ?? DefaultBrowserContext;
 }
		public NancyEvent2Host(string host, int port, INancyBootstrapper bootstrapper)
		{
			_host = host;
			_port = port;
			_bootstrapper = bootstrapper;
			_bootstrapper.Initialise();
			_engine = _bootstrapper.GetEngine();
		}
Example #3
0
        public NancyHost(Uri baseUri, INancyBootstrapper bootStrapper)
        {
            this.baseUri = baseUri;
            listener = new HttpListener();
            listener.Prefixes.Add(baseUri.ToString());

            engine = bootStrapper.GetEngine();
        }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NancyHost"/> class for the specified <paramref name="baseUris"/>, using
        /// the provided <paramref name="bootstrapper"/>.
        /// Uses the specified configuration.
        /// </summary>
        /// <param name="bootstrapper">The bootstrapper that should be used to handle the request.</param>
        /// <param name="configuration">Configuration to use</param>
        /// <param name="baseUris">The <see cref="Uri"/>s that the host will listen to.</param>
        public NancyHost(INancyBootstrapper bootstrapper, HostConfiguration configuration, params Uri[] baseUris)
        {
            this.bootstrapper = bootstrapper;
            this.configuration = configuration ?? new HostConfiguration();
            this.baseUriList = baseUris;

            bootstrapper.Initialise();
            this.engine = bootstrapper.GetEngine();
        }
Example #5
0
        public NancyEvent2Host(string host, int port, INancyBootstrapper bootstrapper, int workers)
        {
            _host = host;
            _port = port;
            _workers = workers;

            bootstrapper.Initialise();
            _engine = bootstrapper.GetEngine();
        }
Example #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NancyHost"/> class for the specfied <paramref name="baseUris"/>, using
        /// the provided <paramref name="bootstrapper"/>.
        /// </summary>
        /// <param name="bootstrapper">The boostrapper that should be used to handle the request.</param>
        /// <param name="baseUris">The <see cref="Uri"/>s that the host will listen to.</param>
        public NancyHost(INancyBootstrapper bootstrapper, params Uri[] baseUris)
        {
            baseUriList = baseUris;
            listener = new HttpListener();

            foreach (var baseUri in baseUriList)
            {
                listener.Prefixes.Add(baseUri.ToString().Replace("localhost", "+"));
            }

            bootstrapper.Initialise();
            engine = bootstrapper.GetEngine();
        }
Example #7
0
        public NancyHost(INancyBootstrapper bootStrapper, params Uri[] baseUris)
        {
            baseUriList = baseUris;
            listener = new HttpListener();

            foreach (var baseUri in baseUriList)
            {
                var prefix = baseUri.ToString();

                if (!baseUri.Host.Contains("."))
                {
                    prefix = prefix.Replace("localhost", "+");
                }

                listener.Prefixes.Add(prefix);
            }

            bootStrapper.Initialise();
            engine = bootStrapper.GetEngine();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="Nancy.Hosting.Owin.NancyOwinHost"/> class.
        /// </summary>
        /// <param name="bootstrapper">The bootstrapper that should be used by the host.</param>
        public NancyWindsorOwinHost(INancyBootstrapper bootstrapper)
        {
            bootstrapper.Initialise();

            engine = bootstrapper.GetEngine();
        }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NancyWcfGenericService"/> class, with the provided <paramref name="bootstrapper"/>.
 /// </summary>
 /// <param name="bootstrapper">An <see cref="INancyBootstrapper"/> instance, that should be used to handle the requests.</param>
 public NancyWcfGenericService(INancyBootstrapper bootstrapper)
 {
     bootstrapper.Initialise();
     this.engine = bootstrapper.GetEngine();
 }
Example #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NancyOwinHost"/> class.
        /// </summary>
        /// <param name="bootstrapper">The bootstrapper that should be used by the host.</param>
        public NancyOwinHost(INancyBootstrapper bootstrapper)
        {
            bootstrapper.Initialise();

            this.engine = bootstrapper.GetEngine();
        }
Example #11
0
 public NancyWcfGenericService(INancyBootstrapper bootstrapper)
 {
     engine = bootstrapper.GetEngine();
 }
Example #12
0
 public NancyTestingWebClient(INancyBootstrapper bootstrapper)
     : this(bootstrapper.GetEngine())
 {
 }
Example #13
0
        public NancyHost(IPAddress address, int port, INancyBootstrapper bootStrapper)
        {
            var filter = new LogFilter();
            filter.AddStandardRules();
            LogFactory.Assign(new ConsoleLogFactory(filter));
            server = new Server();

            bootStrapper.Initialise();
            engine = bootStrapper.GetEngine();

            // same as previous example.
            AppiaModule module = new AppiaModule(engine);
            server.Add(module);
        }
Example #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NancyWcfGenericService"/> class, with the provided <paramref name="bootstrapper"/>.
 /// </summary>
 /// <param name="bootstrapper">An <see cref="INancyBootstrapper"/> instance, that should be used to handle the requests.</param>
 public NancyWcfGenericService(INancyBootstrapper bootstrapper)
 {
     bootstrapper.Initialise();
     this.engine = bootstrapper.GetEngine();
 }
Example #15
0
        public NancyOwinHost(INancyBootstrapper bootstrapper)
        {
            bootstrapper.Initialise();

            this.engine = bootstrapper.GetEngine();
        }