diff --git a/Cloud_Manager/Program.cs b/Cloud_Manager/Program.cs index 4d97138..3f710c6 100644 --- a/Cloud_Manager/Program.cs +++ b/Cloud_Manager/Program.cs @@ -42,11 +42,15 @@ builder.Services.AddSwaggerGen(); var app = builder.Build(); - -app.UseSwagger(); -app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "SecureSwagger v1")); - -app.UseHttpsRedirection(); +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "SecureSwagger v1")); +}else +{ + app.UseHttpsRedirection(); +} app.UseKeyValidation(); app.UseAuthentication();