IW4M-Admin/WebfrontCore/Program.cs
RaidMax c8366a22e5 fixed the vpn detection plugin method signature call
added some fixes for stats/ac
2018-10-06 15:31:05 -05:00

42 lines
1.1 KiB
C#

using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using SharedLibraryCore.Interfaces;
namespace WebfrontCore
{
public class Program
{
public static IManager Manager;
static void Main(string[] args)
{
throw new System.Exception("Webfront core cannot be run as a standalone application");
}
public static void Init(IManager mgr)
{
Manager = mgr;
BuildWebHost().Run();
}
public static IWebHost BuildWebHost()
{
var config = new ConfigurationBuilder()
.AddEnvironmentVariables()
.Build();
return new WebHostBuilder()
#if DEBUG
.UseContentRoot(Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), @"..\..\..\..\", "WebfrontCore")))
#else
.UseContentRoot(SharedLibraryCore.Utilities.OperatingDirectory)
#endif
.UseUrls(Manager.GetApplicationSettings().Configuration().WebfrontBindUrl)
.UseKestrel()
.UseStartup<Startup>()
.Build();
}
}
}