2018-08-15 22:37:23 +00:00
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
|
using System;
|
2018-07-13 12:21:40 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BotSharp.WebHost
|
|
|
|
|
|
{
|
|
|
|
|
|
public class Program
|
|
|
|
|
|
{
|
|
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
|
{
|
|
|
|
|
|
BuildWebHost(args).Run();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static IWebHost BuildWebHost(string[] args) =>
|
|
|
|
|
|
Microsoft.AspNetCore.WebHost.CreateDefaultBuilder(args)
|
2018-08-15 22:37:23 +00:00
|
|
|
|
.ConfigureAppConfiguration((hostingContext, config) =>
|
|
|
|
|
|
{
|
2018-07-13 12:21:40 +00:00
|
|
|
|
var env = hostingContext.HostingEnvironment;
|
2018-08-22 21:36:39 +00:00
|
|
|
|
var settings = Directory.GetFiles(Path.Combine(env.ContentRootPath, "Settings"), "*.json");
|
2018-08-15 22:37:23 +00:00
|
|
|
|
settings.ToList().ForEach(setting =>
|
|
|
|
|
|
{
|
2018-07-13 12:21:40 +00:00
|
|
|
|
config.AddJsonFile(setting, optional: false, reloadOnChange: true);
|
|
|
|
|
|
});
|
|
|
|
|
|
})
|
2018-08-22 21:36:39 +00:00
|
|
|
|
#if RASA_UI
|
2018-08-14 14:23:15 +00:00
|
|
|
|
.UseUrls("http://0.0.0.0:5000")
|
|
|
|
|
|
#else
|
2018-08-10 20:10:53 +00:00
|
|
|
|
.UseUrls("http://0.0.0.0:3112")
|
2018-08-14 14:23:15 +00:00
|
|
|
|
#endif
|
2018-07-13 12:21:40 +00:00
|
|
|
|
.UseStartup<Startup>()
|
|
|
|
|
|
.Build();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|