allow passing port as argument

master
dan 2019-07-17 23:00:44 -06:00
parent 874d7936de
commit dc5f04ae64
1 changed files with 9 additions and 4 deletions

View File

@ -21,10 +21,15 @@ namespace OFBButte.Api
public static IWebHost CreateWebHostBuilder(string[] args)
{
var host = WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseUrls("http://localhost:29021")
.Build();
var hostBuilder = WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
if (args.Length >= 1)
{
hostBuilder.UseUrls($"http://localhost:{args[0]}");
}
var host = hostBuilder.Build();
using(var scope = host.Services.CreateScope())
{