Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bb62b0b

Browse filesBrowse files
Rick-Andersoncommonsensesoftware
authored andcommitted
use IsDevelopment
1 parent 06c47d5 commit bb62b0b
Copy full SHA for bb62b0b

File tree

Expand file treeCollapse file tree

2 files changed

+7
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-1
lines changed

‎examples/AspNetCore/OData/ODataOpenApiExample/Program.cs

Copy file name to clipboardExpand all lines: examples/AspNetCore/OData/ODataOpenApiExample/Program.cs
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
}
9090

9191
app.UseSwagger();
92+
if ( app.Environment.IsDevelopment() )
93+
{
9294
app.UseSwaggerUI(
9395
options =>
9496
{
@@ -102,6 +104,7 @@
102104
options.SwaggerEndpoint( url, name );
103105
}
104106
} );
107+
}
105108

106109
app.UseHttpsRedirection();
107110
app.UseAuthorization();

‎examples/AspNetCore/WebApi/OpenApiExample/Program.cs

Copy file name to clipboardExpand all lines: examples/AspNetCore/WebApi/OpenApiExample/Program.cs
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757
// Configure the HTTP request pipeline.
5858

5959
app.UseSwagger();
60-
app.UseSwaggerUI(
60+
if ( app.Environment.IsDevelopment() )
61+
{
62+
app.UseSwaggerUI(
6163
options =>
6264
{
6365
var descriptions = app.DescribeApiVersions();
@@ -70,6 +72,7 @@
7072
options.SwaggerEndpoint( url, name );
7173
}
7274
} );
75+
}
7376

7477
app.UseHttpsRedirection();
7578
app.UseAuthorization();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.