feat: добавил .net Aspire
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user