From 9e24c9a353dd0c7ca2b1708e456ff8d0e676b385 Mon Sep 17 00:00:00 2001 From: BtbN Date: Thu, 13 Jun 2019 18:47:03 +0200 Subject: [PATCH] Change Program class to follow required pattern --- ClanServer/Program.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ClanServer/Program.cs b/ClanServer/Program.cs index 170b725..4163428 100644 --- a/ClanServer/Program.cs +++ b/ClanServer/Program.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -13,17 +13,21 @@ namespace ClanServer { public class Program { - public static void Main() + public static void Main(string[] args) { - var builder = new WebHostBuilder() + var builder = CreateWebHostBuilder(args); + var host = builder.Build(); + + host.Run(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] _) + { + return new WebHostBuilder() .UseContentRoot(AppContext.BaseDirectory) .UseStartup() .UseKestrel() .ConfigureKestrel(ConfigureKestrel); - - var host = builder.Build(); - - host.Run(); } private static void ConfigureKestrel(WebHostBuilderContext context, KestrelServerOptions options)