-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathProgram.cs
36 lines (34 loc) · 1.1 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace DSM.UI.Api
{
public static class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args)
{
string localIpAddr = Core.Ops.Extensions.GetLocalIPAddress();
IList<string> hosts = new List<string>
{
$"http://localhost:81",
$"http://{localIpAddr}:81"
};
return Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
webBuilder.UseKestrel();
webBuilder.UseContentRoot(Directory.GetCurrentDirectory());
webBuilder.UseIISIntegration();
webBuilder.UseIIS();
webBuilder.UseUrls(hosts.ToArray());
});
}
}
}