Пример #1
0
        public static IWebHostBuilder CreateWebHostBuilder(string[] args)
        {
            if (args.Count() == 1)
            {
                int.TryParse(args[0], out Port);
            }

            var W = WebHost.CreateDefaultBuilder(args)
                    .UseStartup <Startup>()
                    .UseKestrel(options => {
                options.Listen(System.Net.IPAddress.Any, Port, loptions => {
                    loptions.UseHttps(HostCert.GetX509Certificate());
                });
            });

            return(W);
        }