Browse Source

added a dev environment check

dev
Benjamin Arhen 1 year ago
parent
commit
e47856e4bf
  1. 14
      Cloud_Manager/Program.cs

14
Cloud_Manager/Program.cs

@ -42,11 +42,15 @@ builder.Services.AddSwaggerGen();
var app = builder.Build(); var app = builder.Build();
// Configure the HTTP request pipeline.
app.UseSwagger(); if (app.Environment.IsDevelopment())
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "SecureSwagger v1")); {
app.UseSwagger();
app.UseHttpsRedirection(); app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "SecureSwagger v1"));
}else
{
app.UseHttpsRedirection();
}
app.UseKeyValidation(); app.UseKeyValidation();
app.UseAuthentication(); app.UseAuthentication();

Loading…
Cancel
Save