mirror of
https://github.com/dotnet/intro-to-dotnet-web-dev.git
synced 2025-12-06 05:32:03 +01:00
Merge pull request #50 from tdykstra/swaggeruiindev
Call SwaggerUI only in dev env
This commit is contained in:
commit
a0ccfc84da
|
|
@ -14,13 +14,12 @@ var app = builder.Build();
|
||||||
if (app.Environment.IsDevelopment())
|
if (app.Environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
}
|
app.UseSwagger();
|
||||||
|
app.UseSwaggerUI(c =>
|
||||||
app.UseSwagger();
|
{
|
||||||
app.UseSwaggerUI(c =>
|
|
||||||
{
|
|
||||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "PizzaStore API V1");
|
c.SwaggerEndpoint("/swagger/v1/swagger.json", "PizzaStore API V1");
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
app.MapGet("/", () => "Hello World!");
|
app.MapGet("/", () => "Hello World!");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,13 +112,12 @@ Use Swagger to ensure that you have a self-documenting API, where the docs chang
|
||||||
if (app.Environment.IsDevelopment())
|
if (app.Environment.IsDevelopment())
|
||||||
{
|
{
|
||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
}
|
|
||||||
|
|
||||||
app.UseSwagger();
|
app.UseSwagger();
|
||||||
app.UseSwaggerUI(c =>
|
app.UseSwaggerUI(c =>
|
||||||
{
|
{
|
||||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "PizzaStore API V1");
|
c.SwaggerEndpoint("/swagger/v1/swagger.json", "PizzaStore API V1");
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
app.MapGet("/", () => "Hello World!");
|
app.MapGet("/", () => "Hello World!");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue