mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 13:37:21 +01:00
36 lines
No EOL
1.2 KiB
C#
36 lines
No EOL
1.2 KiB
C#
using Microsoft.Extensions.Options;
|
|
|
|
namespace MareSynchronosStaticFilesServer;
|
|
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
var hostBuilder = CreateHostBuilder(args);
|
|
var host = hostBuilder.Build();
|
|
|
|
using (var scope = host.Services.CreateScope())
|
|
{
|
|
var options = host.Services.GetService<IOptions<StaticFilesServerConfiguration>>();
|
|
var logger = host.Services.GetService<ILogger<Program>>();
|
|
logger.LogInformation("Loaded MareSynchronos Static Files Server Configuration");
|
|
logger.LogInformation(options.Value.ToString());
|
|
}
|
|
|
|
host.Run();
|
|
}
|
|
|
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
|
Host.CreateDefaultBuilder(args)
|
|
.UseSystemd()
|
|
.UseConsoleLifetime()
|
|
.ConfigureWebHostDefaults(webBuilder =>
|
|
{
|
|
webBuilder.UseContentRoot(AppContext.BaseDirectory);
|
|
webBuilder.UseStartup<Startup>();
|
|
webBuilder.ConfigureKestrel(opt =>
|
|
{
|
|
opt.Limits.MaxConcurrentConnections = 5000;
|
|
});
|
|
});
|
|
} |