public InterfaceStartup(IHostingEnvironment env, LOIBCBot bot) { var builder = new ConfigurationBuilder(); Configuration = builder.Build(); _bot = bot; }
public LOIBCInterface(string url, LOIBCBot bot) { _webhost = new WebHostBuilder() .UseKestrel() .UseContentRoot(Path.Combine(Directory.GetCurrentDirectory(), "WebInterface")) #if DEBUG .UseContentRoot(Path.Combine(Directory.GetCurrentDirectory(), "src", "WebInterface")) #endif .UseUrls(url) .ConfigureServices(collection => { collection.AddSingleton(bot); }) .UseStartup <InterfaceStartup>() .Build(); Log.Information("Started web interface on {url}", url); _webhost.Start(); }