Files
tnb.server/apihost/Tnb.API.Entry/Program.cs
yang.lee 0dd220ee4f 1、库位导入代码调整
2、电梯通信代码调整
2023-12-11 13:52:54 +08:00

27 lines
966 B
C#

Serve.Run(RunOptions.Default
.AddWebComponent<WebComponent>().WithArgs(args));
public class WebComponent : IWebComponent
{
public void Load(WebApplicationBuilder builder, ComponentContext componentContext)
{
builder.Host.UseWindowsService();
builder.Configuration.AddJsonFile("Location.json", optional: true, reloadOnChange: true);
//// 日志过滤
//builder.Logging.AddFilter((provider, category, logLevel) =>
//{
// return !new[] { "Microsoft.Hosting", "Microsoft.AspNetCore" }.Any(u => category.StartsWith(u)) && logLevel >= LogLevel.Information;
//});
builder.WebHost.ConfigureKestrel(options =>
{
// 长度最好不要设置 null
options.Limits.MaxRequestBodySize = 52428800;
});
//builder.Logging.AddConsoleFormatter(options =>
//{
// options.DateFormat = "yyyy-MM-dd HH:mm:ss(zzz) dddd";
//});
}
}