You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
807 B
C#
35 lines
807 B
C#
using Ds.Module.DynamicApi;
|
|
using Ds.Module.ResultFilter;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
// Add services to the container.
|
|
// 添加SignalR服务
|
|
builder.Services.AddSignalR();
|
|
|
|
builder.Services.AddControllers().AddDynamicWebApi();
|
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
builder.Services.AddSwaggerGen();
|
|
|
|
var app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (app.Environment.IsDevelopment())
|
|
{
|
|
app.UseSwagger();
|
|
app.UseSwaggerUI();
|
|
}
|
|
|
|
//添加SignalR端点
|
|
//endpoints.MapHub<ServerMonitorHub>("/serverMonitorHub");
|
|
//异常错误中间件处理
|
|
app.UseMiddleware<ExceptionHandlerMiddleware>();
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
app.UseAuthorization();
|
|
|
|
app.MapControllers();
|
|
|
|
app.Run(); |