2018-04-08 02:44:42 -04:00
|
|
|
|
using System.IO;
|
2018-02-21 20:29:23 -05:00
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
2018-04-08 14:48:40 -04:00
|
|
|
|
using SharedLibraryCore.Interfaces;
|
2018-02-21 20:29:23 -05:00
|
|
|
|
|
|
|
|
|
namespace WebfrontCore
|
|
|
|
|
{
|
|
|
|
|
public class Program
|
|
|
|
|
{
|
2018-04-08 14:48:40 -04:00
|
|
|
|
public static IManager Manager;
|
|
|
|
|
|
|
|
|
|
public static void Init(IManager mgr)
|
2018-02-21 20:29:23 -05:00
|
|
|
|
{
|
2018-04-08 14:48:40 -04:00
|
|
|
|
Manager = mgr;
|
|
|
|
|
BuildWebHost().Run();
|
2018-04-08 02:44:42 -04:00
|
|
|
|
}
|
2018-03-09 03:01:12 -05:00
|
|
|
|
|
2018-04-08 14:48:40 -04:00
|
|
|
|
public static IWebHost BuildWebHost() =>
|
2018-04-08 02:44:42 -04:00
|
|
|
|
new WebHostBuilder()
|
2018-04-08 17:50:58 -04:00
|
|
|
|
#if DEBUG
|
|
|
|
|
.UseContentRoot(Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), @"..\..\..\..\", "WebfrontCore")))
|
|
|
|
|
#else
|
2018-02-21 20:29:23 -05:00
|
|
|
|
.UseContentRoot(Directory.GetCurrentDirectory())
|
2018-04-08 17:50:58 -04:00
|
|
|
|
#endif
|
2018-04-08 02:44:42 -04:00
|
|
|
|
.UseKestrel()
|
2018-02-21 20:29:23 -05:00
|
|
|
|
.UseStartup<Startup>()
|
|
|
|
|
.Build();
|
|
|
|
|
}
|
|
|
|
|
}
|