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.UseHttpsRedirection();
|
||||||
app.UseSwagger();
|
app.UseSwagger();
|
||||||
app.UseSwaggerUI(c =>
|
if (env.IsDevelopment())
|
||||||
{
|
{
|
||||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My ASP.NET Core 3.0 web API v1");
|
app.UseSwaggerUI(c =>
|
||||||
c.RoutePrefix = string.Empty;
|
{
|
||||||
});
|
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My ASP.NET Core 3.0 web API v1");
|
||||||
|
c.RoutePrefix = string.Empty;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|
Loading…
Reference in New Issue