♻️ Still don't know what I am doing. But basically the microservices are done.

This commit is contained in:
2025-07-14 00:09:32 +08:00
parent cde55eb237
commit 007da589bf
11 changed files with 37 additions and 38 deletions

View File

@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.Extensions.Hosting;
namespace DysonNetwork.Shared.Http;
public static class KestrelConfiguration
{
public static WebApplicationBuilder ConfigureAppKestrel(this WebApplicationBuilder builder)
{
builder.Host.UseContentRoot(Directory.GetCurrentDirectory());
builder.WebHost.ConfigureKestrel(options =>
{
options.Limits.MaxRequestBodySize = 50 * 1024 * 1024;
options.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(2);
options.Limits.RequestHeadersTimeout = TimeSpan.FromSeconds(30);
options.ConfigureEndpointDefaults(endpoints =>
{
endpoints.Protocols = HttpProtocols.Http1AndHttp2;
});
});
return builder;
}
}