PluralKit/PluralKit.API/Program.cs

33 lines
1.0 KiB
C#
Raw Normal View History

2020-01-26 00:27:45 +00:00
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Hosting;
2020-08-27 21:35:47 +00:00
using Microsoft.Extensions.DependencyInjection;
2020-01-26 00:27:45 +00:00
using Microsoft.Extensions.Hosting;
using PluralKit.Core;
2020-08-27 21:36:02 +00:00
using Serilog;
namespace PluralKit.API
{
public class Program
{
public static void Main(string[] args)
{
2020-06-13 17:36:43 +00:00
InitUtils.InitStatic();
2020-01-26 00:27:45 +00:00
CreateHostBuilder(args).Build().Run();
}
2020-01-26 00:27:45 +00:00
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
2020-08-27 21:36:02 +00:00
.UseSerilog()
2020-01-26 00:27:45 +00:00
.ConfigureWebHostDefaults(whb => whb
.UseConfiguration(InitUtils.BuildConfiguration(args).Build())
2020-08-27 21:35:47 +00:00
.ConfigureKestrel(opts =>
{
opts.ListenAnyIP(opts.ApplicationServices.GetRequiredService<ApiConfig>().Port);
})
2020-01-26 00:27:45 +00:00
.UseStartup<Startup>());
}
}