refactor(API): update to use .net8

This commit is contained in:
2025-07-29 14:23:55 +02:00
parent 48724922af
commit 467588429b
5 changed files with 49 additions and 27 deletions

View File

@@ -1,15 +1,17 @@
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi();
// 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.MapOpenApi();
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
@@ -31,7 +33,8 @@ app.MapGet("/weatherforecast", () =>
.ToArray();
return forecast;
})
.WithName("GetWeatherForecast");
.WithName("GetWeatherForecast")
.WithOpenApi();
app.Run();