IW4M-Admin/WebfrontCore/Program.cs

35 lines
873 B
C#
Raw Normal View History

using System;
using System.IO;
2018-02-21 20:29:23 -05:00
using Microsoft.AspNetCore.Hosting;
2018-03-09 03:01:12 -05:00
using Microsoft.Extensions.Configuration;
2018-02-21 20:29:23 -05:00
namespace WebfrontCore
{
public class Program
{
public static void Main(string[] args)
{
2018-03-09 03:01:12 -05:00
var config = new ConfigurationBuilder()
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.Build();
2018-02-21 20:29:23 -05:00
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseStartup<Startup>()
2018-03-09 03:01:12 -05:00
.UseUrls(config["Web:Address"])
2018-02-21 20:29:23 -05:00
.Build();
if (!SharedLibrary.Utilities.IsRunningOnMono())
{
host.Run();
}
else
{
Console.ReadLine();
}
2018-02-21 20:29:23 -05:00
}
}
}