|
|
@ -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(); |
|
|
|