Skip to content

Commit 26de018

Browse files
committed
stuff
1 parent e6f1b2c commit 26de018

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Microservices/CatalogMicroservice/CatalogMicroservice.API/Program.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@
3535

3636
var app = builder.Build();
3737

38-
if (app.Environment.IsDevelopment())
38+
var shouldShowSwagger = Environment.GetEnvironmentVariable(
39+
"SHOULD_SHOW_SWAGGER",
40+
EnvironmentVariableTarget.Process
41+
) ?? "";
42+
43+
if (app.Environment.IsDevelopment() || shouldShowSwagger is "true")
3944
{
4045
app.UseSwagger();
4146
app.UseSwaggerUI(c =>

src/Microservices/CatalogMicroservice/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ services:
1414
- catalog-microservice
1515
environment:
1616
- SQL_CONNECTION_STRING=Data Source=catalog-sqlserver;Integrated Security=false;User ID=sa;Password=@sineThingComplicated1234;Encrypt=false;TrustServerCertificate=true;
17+
- SHOULD_SHOW_SWAGGER=true
1718

1819
catalog-sqlserver:
1920
image: mcr.microsoft.com/azure-sql-edge

0 commit comments

Comments
 (0)