public static void Main(string[] args) { BenchmarksEventSource.MeasureAspNetVersion(); BenchmarksEventSource.MeasureNetCoreAppVersion(); CreateHostBuilder(args).Build().Run(); }
public static void Main(string[] args) { Console.WriteLine($"Process ID: {Process.GetCurrentProcess().Id}"); BenchmarksEventSource.MeasureAspNetVersion(); BenchmarksEventSource.MeasureNetCoreAppVersion(); var config = new ConfigurationBuilder() .AddEnvironmentVariables(prefix: "ASPNETCORE_") .AddCommandLine(args) .Build(); var host = new WebHostBuilder() .UseConfiguration(config) .ConfigureLogging(loggerFactory => { if (Enum.TryParse(config["LogLevel"], out LogLevel logLevel)) { loggerFactory.AddConsole().SetMinimumLevel(logLevel); } }) .UseKestrel() .UseStartup <Startup>(); host.Build().Run(); }
public static void Main(string[] args) { var config = new ConfigurationBuilder() .AddEnvironmentVariables(prefix: "ASPNETCORE_") .AddCommandLine(args) .Build(); // The url all requests will be forwarded to var baseUriArg = config["baseUri"]; if (String.IsNullOrWhiteSpace(baseUriArg)) { throw new ArgumentException("--baseUri is required"); } var baseUri = new Uri(baseUriArg); // Cache base URI values _scheme = baseUri.Scheme; _host = new HostString(baseUri.Authority); _pathBase = baseUri.AbsolutePath; _appendQuery = new QueryString(baseUri.Query); Console.WriteLine($"Base URI: {baseUriArg}"); BenchmarksEventSource.MeasureAspNetVersion(); BenchmarksEventSource.MeasureNetCoreAppVersion(); var builder = new WebHostBuilder() .ConfigureLogging(loggerFactory => { // Don't enable console logging if no specific level is defined (perf) if (Enum.TryParse(config["LogLevel"], out LogLevel logLevel)) { Console.WriteLine($"Console Logging enabled with level '{logLevel}'"); loggerFactory.AddConsole().SetMinimumLevel(logLevel); } }) .UseKestrel((context, kestrelOptions) => { kestrelOptions.ConfigureHttpsDefaults(httpsOptions => { httpsOptions.ServerCertificate = new X509Certificate2(Path.Combine(context.HostingEnvironment.ContentRootPath, "testCert.pfx"), "testPassword"); }); }) .UseContentRoot(Directory.GetCurrentDirectory()) .UseConfiguration(config) ; InitializeHttpClient(); builder = builder.Configure(app => app.Run(ProxyRequest)); builder .Build() .Run(); }
public void Configure(IApplicationBuilder app) { BenchmarksEventSource.MeasureAspNetVersion(); BenchmarksEventSource.MeasureNetCoreAppVersion(); app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapReverseProxy(); }); }
public void Configure(IApplicationBuilder app) { BenchmarksEventSource.MeasureAspNetVersion(); BenchmarksEventSource.MeasureNetCoreAppVersion(); app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapReverseProxy(builder => { // Skip SessionAffinity, LoadBalancing and PassiveHealthChecks }); }); }
public void Configure(IApplicationBuilder app) { BenchmarksEventSource.MeasureNetCoreAppVersion(); BenchmarksEventSource.MeasureAspNetVersion(); }