DocSpace-client/web/ASC.Web.Studio/Program.cs

37 lines
1.3 KiB
C#
Raw Normal View History

2019-06-21 08:03:42 +00:00
using System.IO;
2019-05-15 14:56:09 +00:00
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
2019-06-11 08:26:40 +00:00
using Microsoft.Extensions.Hosting;
2019-05-15 14:56:09 +00:00
namespace ASC.Web.Studio
{
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
2019-06-11 08:26:40 +00:00
public static IHostBuilder CreateWebHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(w=>
{
w.UseStartup<Startup>();
})
.ConfigureAppConfiguration((hostingContext, config) => {
2019-06-21 08:03:42 +00:00
var buided = config.Build();
var path = buided["pathToConf"];
if (!Path.IsPathRooted(path)) {
path = Path.GetFullPath(Path.Combine(hostingContext.HostingEnvironment.ContentRootPath, path));
}
config.SetBasePath(path);
2019-06-11 08:26:40 +00:00
config
2019-06-21 08:03:42 +00:00
.AddJsonFile("appsettings.json")
.AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true)
2019-06-11 08:26:40 +00:00
.AddJsonFile("autofac.json")
.AddJsonFile("storage.json")
.AddJsonFile("kafka.json");
2019-06-11 08:26:40 +00:00
});
2019-05-15 14:56:09 +00:00
}
}