From bd354344e41d41995501e36bae8b1d61d0a079e5 Mon Sep 17 00:00:00 2001 From: Louis LABORIE Date: Thu, 6 Feb 2025 08:51:14 +0100 Subject: [PATCH] Removing swagger options :mute::mute: --- Server/Program.cs | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/Server/Program.cs b/Server/Program.cs index b3d0dbf..1dee5c0 100644 --- a/Server/Program.cs +++ b/Server/Program.cs @@ -59,23 +59,17 @@ builder.Services.AddRouting(options => options.LowercaseUrls = true); var app = builder.Build(); // Configure the HTTP request pipeline. -//if (app.Environment.IsDevelopment()) -// { -// app.UseSwagger(); -// app.UseSwaggerUI(c => -// { -// c.SwaggerEndpoint("/swagger/v1/swagger.json", "Optifit API v1"); -// c.RoutePrefix = string.Empty; // Serve Swagger UI at the app's root -// }); -// app.UseHttpsRedirection(); -//} - -app.UseSwagger(); -app.UseSwaggerUI(c => +if (app.Environment.IsDevelopment()) { - c.SwaggerEndpoint("/swagger/v1/swagger.json", "Optifit API v1"); - c.RoutePrefix = string.Empty; // Serve Swagger UI at the app's root -}); + app.UseSwagger(); + app.UseSwaggerUI(c => + { + c.SwaggerEndpoint("/swagger/v1/swagger.json", "Optifit API v1"); + c.RoutePrefix = string.Empty; // Serve Swagger UI at the app's root + }); + app.UseHttpsRedirection(); +} + app.UseAuthorization(); app.MapControllers(); app.Run(); \ No newline at end of file