1 Star 0 Fork 12

velprophoenix/oiocns-data

forked from Orginone/oiocns-data 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Program.cs 1.52 KB
一键复制 编辑 原始数据 按行查看 历史
realVeer 提交于 2024-07-19 23:25 . fix: 暂存
var builder = WebApplication.CreateBuilder(args);
builder.Configuration.Initialization();
builder.Logging.ClearProviders();
builder.Logging.AddConsole();
builder.Logging.SetMinimumLevel(Config.LogLevel);
builder.Services.AddResponseCaching();
builder.Services.AddResponseCompression();
builder.Services.AddControllers().AddNewtonsoftJson(option =>
{
option.SerializerSettings.Setting();
});
builder.Services.AddSignalR(option =>
{
option.StreamBufferCapacity = 20;
option.KeepAliveInterval = TimeSpan.FromSeconds(2);
option.HandshakeTimeout = TimeSpan.FromSeconds(5);
option.ClientTimeoutInterval = TimeSpan.FromSeconds(5);
option.MaximumReceiveMessageSize = 10 * 1024 * 1024;
}).AddNewtonsoftJsonProtocol(option =>
{
option.PayloadSerializerSettings.Setting();
});
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddLocalServices();
builder.Services.AddHostedService<KernelHubWorker>();
var app = builder.Build();
app.UseStatusCodePages(ErrorHanlder.StatusCode);
app.UseExceptionHandler(ErrorHanlder.Exception);
app.UseCors();
app.UseRouting();
app.UseResponseCaching();
app.UseResponseCompression();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapProxy("/orginone/anydata/proxy/http");
endpoints.MapHub<DataHub>("/orginone/anydata/hub");
});
var runTask = app.RunAsync(Config.Urls);
foreach (var url in app.Urls)
{
Console.WriteLine($"Starting server at {url}");
}
runTask.Wait();
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/beimo6717/oiocns-data.git
git@gitee.com:beimo6717/oiocns-data.git
beimo6717
oiocns-data
oiocns-data
main

搜索帮助