Skip to content

Commit 84b1b80

Browse files
Rick-Andersoncommonsensesoftware
authored andcommitted
use IsDevelopment
1 parent 3468695 commit 84b1b80

File tree

1 file changed

+4
-2
lines changed
  • examples/AspNetCore/OData/SomeODataOpenApiExample

1 file changed

+4
-2
lines changed

examples/AspNetCore/OData/SomeODataOpenApiExample/Program.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@
6464
// Configure the HTTP request pipeline.
6565

6666
app.UseSwagger();
67-
app.UseSwaggerUI(
67+
if ( builder.Environment.IsDevelopment() )
68+
{
69+
app.UseSwaggerUI(
6870
options =>
6971
{
7072
var descriptions = app.DescribeApiVersions();
@@ -77,7 +79,7 @@
7779
options.SwaggerEndpoint( url, name );
7880
}
7981
} );
80-
82+
}
8183
app.UseHttpsRedirection();
8284
app.UseAuthorization();
8385
app.MapControllers();

0 commit comments

Comments
 (0)