2017-12-30 20:26:35 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using Microsoft.AspNetCore;
|
|
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Bot.WebStarter
|
|
|
|
|
|
{
|
|
|
|
|
|
public class Program
|
|
|
|
|
|
{
|
|
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
|
{
|
|
|
|
|
|
BuildWebHost(args).Run();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static IWebHost BuildWebHost(string[] args) =>
|
|
|
|
|
|
WebHost.CreateDefaultBuilder(args)
|
2018-03-19 02:07:36 +00:00
|
|
|
|
.ConfigureAppConfiguration((hostingContext, config) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
var env = hostingContext.HostingEnvironment;
|
|
|
|
|
|
var settings = Directory.GetFiles("./", "settings.*.json");
|
|
|
|
|
|
settings.ToList().ForEach(setting =>
|
|
|
|
|
|
{
|
|
|
|
|
|
config.AddJsonFile(setting, optional: false, reloadOnChange: true);
|
|
|
|
|
|
});
|
|
|
|
|
|
})
|
|
|
|
|
|
.UseUrls("http://localhost:9900")
|
2017-12-30 20:26:35 +00:00
|
|
|
|
.UseStartup<Startup>()
|
|
|
|
|
|
.Build();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|