The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Program.cs 1.1KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using Microsoft.AspNetCore;
  2. using Microsoft.AspNetCore.Hosting;
  3. using Microsoft.Extensions.Configuration;
  4. using Microsoft.Extensions.Logging;
  5. using System.IO;
  6. using Teknik.Configuration;
  7. using Teknik.Logging;
  8. namespace Teknik.IdentityServer
  9. {
  10. public class Program
  11. {
  12. public static void Main(string[] args)
  13. {
  14. BuildWebHost(args).Run();
  15. }
  16. public static IWebHost BuildWebHost(string[] args)
  17. {
  18. var config = new ConfigurationBuilder()
  19. .AddJsonFile("appsettings.json", optional: true)
  20. .AddCommandLine(args)
  21. .Build();
  22. return WebHost.CreateDefaultBuilder(args)
  23. .UseConfiguration(config)
  24. .UseStartup<Startup>()
  25. .ConfigureLogging((hostingContext, logging) =>
  26. {
  27. string baseDir = hostingContext.HostingEnvironment.ContentRootPath;
  28. string dataDir = Path.Combine(baseDir, "App_Data");
  29. logging.AddProvider(new LoggerProvider(Config.Load(dataDir)));
  30. })
  31. .Build();
  32. }
  33. }
  34. }