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.2KB

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