PluralKit/PluralKit.API/Program.cs

27 lines
815 B
C#
Raw Normal View History

2020-01-26 00:27:45 +00:00
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Hosting;
2020-01-26 00:27:45 +00:00
using Microsoft.Extensions.Hosting;
using PluralKit.Core;
namespace PluralKit.API
{
public class Program
{
public static void Main(string[] args)
{
2020-06-13 17:21:24 +00:00
Database.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())
.ConfigureWebHostDefaults(whb => whb
.UseConfiguration(InitUtils.BuildConfiguration(args).Build())
.ConfigureKestrel(opts => { opts.ListenAnyIP(5000); })
.UseStartup<Startup>());
}
}