mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using Microsoft.AspNetCore;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.Logging;
|
|
using System.IO;
|
|
using Teknik.Configuration;
|
|
using Teknik.Logging;
|
|
|
|
namespace Teknik.IdentityServer
|
|
{
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
BuildWebHost(args).Run();
|
|
}
|
|
|
|
public static IWebHost BuildWebHost(string[] args)
|
|
{
|
|
var config = new ConfigurationBuilder()
|
|
.AddJsonFile("appsettings.json", optional: true)
|
|
.AddCommandLine(args)
|
|
.Build();
|
|
|
|
return WebHost.CreateDefaultBuilder(args)
|
|
.UseConfiguration(config)
|
|
.UseStartup<Startup>()
|
|
.ConfigureLogging((hostingContext, logging) =>
|
|
{
|
|
string baseDir = hostingContext.HostingEnvironment.ContentRootPath;
|
|
string dataDir = Path.Combine(baseDir, "App_Data");
|
|
logging.AddProvider(new LoggerProvider(Config.Load(dataDir)));
|
|
})
|
|
.Build();
|
|
}
|
|
}
|
|
}
|