DocSpace-client/products/ASC.People/Server/Program.cs

43 lines
1.5 KiB
C#
Raw Normal View History

using System.IO;
2019-05-15 14:56:09 +00:00
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
2019-05-15 14:56:09 +00:00
namespace ASC.People
{
public class Program
{
public static void Main(string[] args)
2019-10-21 12:33:02 +00:00
{
CreateHostBuilder(args).Build().Run();
2019-05-15 14:56:09 +00:00
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
2019-08-15 12:04:42 +00:00
.ConfigureAppConfiguration((hostingContext, config) =>
{
var buided = config.Build();
var path = buided["pathToConf"];
if (!Path.IsPathRooted(path))
{
path = Path.GetFullPath(Path.Combine(hostingContext.HostingEnvironment.ContentRootPath, path));
}
config.SetBasePath(path);
config
.AddJsonFile("appsettings.json")
.AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true)
.AddJsonFile("autofac.json")
.AddJsonFile("autofac.products.json")
.AddJsonFile("storage.json")
2019-08-23 12:49:23 +00:00
.AddJsonFile("kafka.json")
2019-11-14 09:21:15 +00:00
.AddJsonFile($"kafka.{hostingContext.HostingEnvironment.EnvironmentName}.json", true)
.AddEnvironmentVariables();
});
2019-05-15 14:56:09 +00:00
}
}