Skip to content

Commit ee4a0e9

Browse files
authored
Only enable SwaggerUI in development (#56455)
1 parent ce80910 commit ee4a0e9

File tree

1 file changed

+6
-3
lines changed
  • src/Grpc/JsonTranscoding/test/testassets/Sandbox

1 file changed

+6
-3
lines changed

src/Grpc/JsonTranscoding/test/testassets/Sandbox/Startup.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
3030

3131
#region Secret
3232
app.UseSwagger();
33-
app.UseSwaggerUI(c =>
33+
if (env.IsDevelopment())
3434
{
35-
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
36-
});
35+
app.UseSwaggerUI(c =>
36+
{
37+
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
38+
});
39+
}
3740
#endregion
3841

3942
app.UseRouting();

0 commit comments

Comments
 (0)