本文整理汇总了C#中INancyBootstrapper类的典型用法代码示例。如果您正苦于以下问题:C# INancyBootstrapper类的具体用法?C# INancyBootstrapper怎么用?C# INancyBootstrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
INancyBootstrapper类属于命名空间,在下文中一共展示了INancyBootstrapper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: NancyHttpHost
internal NancyHttpHost(Uri baseUri, PactConfig config, INancyBootstrapper bootstrapper)
{
_baseUri = baseUri;
_bootstrapper = bootstrapper;
_log = LogProvider.GetLogger(config.LoggerName);
_config = config;
}
开发者ID:humblelistener,项目名称:pact-net,代码行数:7,代码来源:NancyHttpHost.cs
示例2: Browser
/// <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, bool initialiseBootstrapper = true)
{
this.bootstrapper = bootstrapper;
if (initialiseBootstrapper) this.bootstrapper.Initialise();
this.engine = this.bootstrapper.GetEngine();
this.defaultBrowserContext = defaults ?? this.DefaultBrowserContext;
}
开发者ID:AIexandr,项目名称:Nancy,代码行数:12,代码来源:Browser.cs
示例3: WebServer
public WebServer(INancyBootstrapper bootstrapper)
{
_nancyHost = new NancyHost(new Uri("http://localhost:1234"), bootstrapper, new HostConfiguration
{
RewriteLocalhost = false
});
}
开发者ID:kbortnik,项目名称:mailfunnel,代码行数:7,代码来源:WebServer.cs
示例4: NancyOwinHostFixture
public NancyOwinHostFixture()
{
this.fakeEngine = A.Fake<INancyEngine>();
this.fakeBootstrapper = A.Fake<INancyBootstrapper>();
A.CallTo(() => this.fakeBootstrapper.GetEngine()).Returns(this.fakeEngine);
this.host = new NancyOwinHost(fakeBootstrapper);
this.fakeResponseCallback = (status, headers, bodyDelegate) => { };
this.fakeErrorCallback = (ex) => { };
this.environment = new Dictionary<string, object>()
{
{ "owin.RequestMethod", "GET" },
{ "owin.RequestPath", "/test" },
{ "owin.RequestPathBase", "/root" },
{ "owin.RequestQueryString", "var=value" },
{ "owin.RequestHeaders", new Dictionary<string, string> { { "Host", "testserver" } } },
{ "owin.RequestBody", null },
{ "owin.RequestScheme", "http" },
{ "owin.Version", "1.0" }
};
}
开发者ID:ChrisMH,项目名称:Nancy,代码行数:26,代码来源:NancyOwinHostFixture.cs
示例5: Browser
/// <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)
{
this.bootstrapper = bootstrapper;
this.bootstrapper.Initialise();
this.engine = this.bootstrapper.GetEngine();
this.defaultBrowserContext = defaults ?? DefaultBrowserContext;
}
开发者ID:rdterner,项目名称:Nancy,代码行数:12,代码来源:Browser.cs
示例6: NancyEvent2Host
public NancyEvent2Host(string host, int port, INancyBootstrapper bootstrapper)
{
_host = host;
_port = port;
_bootstrapper = bootstrapper;
_bootstrapper.Initialise();
_engine = _bootstrapper.GetEngine();
}
开发者ID:kekekeks,项目名称:Nancy.Hosting.Event.2,代码行数:8,代码来源:NancyEvent2Host.cs
示例7: NancyHost
public NancyHost(Uri baseUri, INancyBootstrapper bootStrapper)
{
this.baseUri = baseUri;
listener = new HttpListener();
listener.Prefixes.Add(baseUri.ToString());
engine = bootStrapper.GetEngine();
}
开发者ID:avlasova,项目名称:Nancy,代码行数:8,代码来源:NancyHost.cs
示例8: NancyHost
/// <summary>
/// Initializes a new instance of the <see cref="NancyHost"/> class for the specfied <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.configuration = configuration ?? new HostConfiguration();
this.baseUriList = baseUris;
bootstrapper.Initialise();
this.engine = bootstrapper.GetEngine();
}
开发者ID:frankgeerlings,项目名称:Nancy,代码行数:16,代码来源:NancyHost.cs
示例9: HtmlExporter
public HtmlExporter(string exportPath,
IConfiguration configuration,
INancyBootstrapper bootStrapper)
{
_configuration = configuration;
_exportPath = exportPath;
_basePath = Directory.GetCurrentDirectory();
_bootStrapper = bootStrapper;
}
开发者ID:aqueduct,项目名称:Appia,代码行数:9,代码来源:HtmlExporter.cs
示例10: HttpServer
public HttpServer(ILogger<HttpServer> logger, INancyBootstrapper bootstrapper, IKeyValueStore keyValueStore)
{
if (logger == null) throw new ArgumentNullException("logger");
if (bootstrapper == null) throw new ArgumentNullException("bootstrapper");
if (keyValueStore == null) throw new ArgumentNullException("keyValueStore");
_logger = logger;
_bootstrapper = bootstrapper;
_keyValueStore = keyValueStore;
}
开发者ID:DNIDNL,项目名称:hadouken,代码行数:9,代码来源:HttpServer.cs
示例11: NancyEvent2Host
public NancyEvent2Host(string host, int port, INancyBootstrapper bootstrapper, int workers)
{
_host = host;
_port = port;
_workers = workers;
bootstrapper.Initialise();
_engine = bootstrapper.GetEngine();
}
开发者ID:kekekeks,项目名称:evhttp-sharp,代码行数:9,代码来源:NancyEvent2Host.cs
示例12: TopService
public TopService(INancyBootstrapper ninjectNancyBootstrapper, ServiceSettings serviceSettings, Logger logger, IScheduler scheduler)
{
_serviceSettings = serviceSettings;
_ninjectNancyBootstrapper = ninjectNancyBootstrapper;
_scheduler = scheduler;
_logger = logger;
logger.Info("Service was created with base url {0}", serviceSettings.BaseUrl);
Trace.WriteLine("Service was created with base url: "+serviceSettings.BaseUrl);
}
开发者ID:mamluka,项目名称:SpeedyMailer,代码行数:10,代码来源:ServiceHost.cs
示例13: RunServer
private void RunServer(INancyBootstrapper nancyBootstrapper, HostConfiguration hostConfiguration)
{
var hostAddress = new Uri(HostAddress);
m_NancyHost = new NancyHost(
hostAddress,
nancyBootstrapper,
hostConfiguration
);
m_NancyHost.Start();
}
开发者ID:modulexcite,项目名称:learnsomesql.com,代码行数:10,代码来源:SelfHostedWebApp.cs
示例14: WebServer
public WebServer(INancyBootstrapper webBootstrapper, IConfigManager configManager)
{
_webBootstrapper = webBootstrapper;
_logger = Log.ForContext<WebServer>();
BindInterface = configManager.WebServerConfig.BindInterface;
Port = configManager.WebServerConfig.Port;
if (configManager.WebServerConfig.Enabled)
Start();
}
开发者ID:carloslozano,项目名称:CoiniumServ,代码行数:11,代码来源:WebServer.cs
示例15: Enable
/// <summary>
///
/// </summary>
/// <param name="nancyBootstrapper"></param>
/// <param name="routeResolver"></param>
/// <param name="pipeline"></param>
/// <param name="cacheKeyGenerator"></param>
/// <param name="cacheStore"></param>
public static void Enable(INancyBootstrapper nancyBootstrapper, IRouteResolver routeResolver, IPipelines pipeline, ICacheKeyGenerator cacheKeyGenerator, ICacheStore cacheStore)
{
if (_enabled)
return;
_enabled = true;
_cacheKeyGenerator = cacheKeyGenerator;
_cacheStore = cacheStore;
_nancyBootstrapper = nancyBootstrapper;
_routeResolver = routeResolver;
pipeline.BeforeRequest.AddItemToStartOfPipeline(CheckCache);
pipeline.AfterRequest.AddItemToEndOfPipeline(SetCache);
}
开发者ID:khellang,项目名称:Solvberget,代码行数:20,代码来源:CustomNancyLightningCache.cs
示例16: Enable
/// <summary>
///
/// </summary>
/// <param name="nancyBootstrapper"></param>
/// <param name="routeResolver"></param>
/// <param name="pipeline"></param>
/// <param name="varyParams"></param>
/// <param name="cacheStore"></param>
public static void Enable(INancyBootstrapper nancyBootstrapper, IRouteResolver routeResolver, IPipelines pipeline, IEnumerable<string> varyParams, ICacheStore cacheStore)
{
if (_enabled)
return;
_enabled = true;
_varyParams = varyParams.Select(key => key.ToLower().Trim()).ToArray();
_cacheStore = cacheStore;
_nancyBootstrapper = nancyBootstrapper;
_routeResolver = routeResolver;
pipeline.BeforeRequest.AddItemToStartOfPipeline(CheckCache);
pipeline.AfterRequest.AddItemToEndOfPipeline(SetCache);
}
开发者ID:jchindev,项目名称:testing1,代码行数:20,代码来源:LightningCache.cs
示例17: NancyHost
/// <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();
}
开发者ID:raoulmillais,项目名称:Nancy,代码行数:19,代码来源:NancyHost.cs
示例18: module_tests_base
public module_tests_base()
{
AppDomainAssemblyTypeScanner.LoadAssemblies("*.dll");
_bootstrapper = new ConfigurableBootstrapper(config => config.ViewFactory<TestingViewFactory>());
_browser = new Browser(_bootstrapper);
}
开发者ID:KoprowskiT,项目名称:msmvppl,代码行数:7,代码来源:module_tests_base.cs
示例19: TracingSmokeTests
public TracingSmokeTests()
{
this.bootstrapper = new ConfigurableBootstrapper(
configuration => configuration.Modules(new Type[] { typeof(RazorWithTracingTestModule) }));
this.browser = new Browser(bootstrapper);
}
开发者ID:afwilliams,项目名称:Nancy,代码行数:7,代码来源:TracingSmokeTests.cs
示例20: SerializeTests
public SerializeTests()
{
this.bootstrapper = new ConfigurableBootstrapper(
configuration => configuration.Modules(new Type[] { typeof(SerializeTestModule) }));
this.browser = new Browser(bootstrapper);
}
开发者ID:JulianRooze,项目名称:Nancy,代码行数:7,代码来源:SerializeTests.cs
注:本文中的INancyBootstrapper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论