Use command line args when configuring the server

This commit is contained in:
Frank A. Krueger 2017-11-15 22:01:51 -06:00
parent b67e87d19e
commit 3a7b01e747
1 changed files with 7 additions and 6 deletions

View File

@ -12,14 +12,15 @@ namespace AspNetCoreMvc
{
public class Program
{
public static void Main(string[] args)
public static void Main (string[] args)
{
BuildWebHost(args).Run();
BuildWebHost (args).Run ();
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.Build();
public static IWebHost BuildWebHost (string[] args) =>
WebHost.CreateDefaultBuilder (args)
.UseConfiguration (new ConfigurationBuilder ().AddCommandLine (args).Build ())
.UseStartup<Startup> ()
.Build ();
}
}