diff --git a/fundamentals/middleware/problem-details-service/Program.cs b/fundamentals/middleware/problem-details-service/Program.cs index d2ffc12..a2ada2c 100644 --- a/fundamentals/middleware/problem-details-service/Program.cs +++ b/fundamentals/middleware/problem-details-service/Program.cs @@ -1,20 +1,14 @@ -#define DISABLE // MIDDLEWARE API_CONTROLLER API_CONT_SHORT DEFAULT DISABLE +#define API_CONTROLLER // MIDDLEWARE API_CONTROLLER API_CONT_SHORT DEFAULT DISABLE #if NEVER #elif MIDDLEWARE // var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllers(); -builder.Services.AddEndpointsApiExplorer(); -builder.Services.AddSwaggerGen(); -builder.Services.AddProblemDetails(); -var app = builder.Build(); -if (app.Environment.IsDevelopment()) -{ - app.UseSwagger(); - app.UseSwaggerUI(); -} +builder.Services.AddProblemDetails(); + +var app = builder.Build(); app.UseHttpsRedirection(); app.UseStatusCodePages(); @@ -88,8 +82,6 @@ app.Run(); var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllers(); -builder.Services.AddEndpointsApiExplorer(); -builder.Services.AddSwaggerGen(); builder.Services.AddProblemDetails(options => options.CustomizeProblemDetails = (context) => @@ -117,12 +109,6 @@ builder.Services.AddProblemDetails(options => var app = builder.Build(); -if (app.Environment.IsDevelopment()) -{ - app.UseSwagger(); - app.UseSwaggerUI(); -} - app.UseHttpsRedirection(); app.UseStatusCodePages();