feat: добавил .net Aspire

This commit is contained in:
2026-05-11 00:20:39 +03:00
parent aaba62b739
commit a04c20c857
13 changed files with 282 additions and 1 deletions
+13 -1
View File
@@ -14,6 +14,13 @@ using UniVerse.Infrastructure.ExternalServices;
var builder = WebApplication.CreateBuilder(args);
var useAspire = builder.Configuration.GetValue<bool>("Aspire:Enabled");
if (useAspire)
{
builder.AddServiceDefaults();
}
// --- Serilog ---
Log.Logger = new LoggerConfiguration()
.ReadFrom.Configuration(builder.Configuration)
@@ -139,6 +146,11 @@ builder.Services.AddSwaggerGen(options =>
var app = builder.Build();
if (useAspire)
{
app.MapDefaultEndpoints();
}
// --- Middleware Pipeline ---
app.UseMiddleware<RequestLoggingMiddleware>();
app.UseMiddleware<ExceptionHandlingMiddleware>();
@@ -162,4 +174,4 @@ app.UseAuthentication();
app.UseAuthorization();
app.MapControllers();
app.Run();
app.Run();
+1
View File
@@ -27,6 +27,7 @@
<ItemGroup>
<ProjectReference Include="..\UniVerse.Application\UniVerse.Application.csproj" />
<ProjectReference Include="..\UniVerse.Infrastructure\UniVerse.Infrastructure.csproj" />
<ProjectReference Include="..\UniVerse.ServiceDefaults\UniVerse.ServiceDefaults.csproj" />
</ItemGroup>
<ItemGroup>