Merge pull request #32373 from dotnet/captainsafia-patch-2
Put Swagger UI behind development check (WebApiSample.Api.31)pull/32374/head
commit
245b90eda0
|
@ -57,11 +57,14 @@ namespace WebApiSample.Api._31
|
|||
|
||||
app.UseHttpsRedirection();
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI(c =>
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My ASP.NET Core 3.0 web API v1");
|
||||
c.RoutePrefix = string.Empty;
|
||||
});
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My ASP.NET Core 3.0 web API v1");
|
||||
c.RoutePrefix = string.Empty;
|
||||
});
|
||||
}
|
||||
|
||||
app.UseRouting();
|
||||
app.UseAuthorization();
|
||||
|
|
Loading…
Reference in New Issue