Skip to content

Commit

Permalink
Merge pull request #54 from Rick-Anderson/patch-4
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
jamesmontemagno authored May 9, 2024
2 parents 38939e0 + c69fa6c commit 8b4bf9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 4-minimal-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Use Swagger to ensure that you have a self-documenting API, where the docs chang
{
app.UseDeveloperExceptionPage();
app.UseSwagger();
app.UseSwaggerUI(c =>
app.UseSwaggerUI(c => // UseSwaggerUI Protected by if (env.IsDevelopment())
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "PizzaStore API V1");
});
Expand All @@ -128,7 +128,7 @@ Use Swagger to ensure that you have a self-documenting API, where the docs chang
- The `using` statement at the top makes it easier to use the *Swashbuckle* package without having to type out long namespaces for the commands.
- The two `builder.Services.Add` lines add the two services that *Swashbuckle* needs to generate the documentation.
- The `UseSwagger` and `UseSwaggerUI` lines add the Swagger and Swagger UI endpoints.
- The `UseSwagger` and `UseSwaggerUI` lines add the Swagger and Swagger UI endpoints. UseSwaggerUI is called only in development.
1. Rerun the project and go to the app's address, `http://localhost:{PORT}/swagger`.
Expand Down

0 comments on commit 8b4bf9b

Please sign in to comment.