Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
var pathBase = Configuration["PATH_BASE"];

app.UseSwagger();
if (app.Environment.IsDevelopment())
if (env.IsDevelopment())
{
app.UseSwaggerUI(c =>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// This file was auto-generated by ML.NET Model Builder.
// This file was auto-generated by ML.NET Model Builder.
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.ML;
using Microsoft.OpenApi.Models;
Expand All @@ -20,10 +21,13 @@

app.UseSwagger();

app.UseSwaggerUI(c =>
if (app.Environment.IsDevelopment())
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
});
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1");
});
}

// Define prediction route & handler
app.MapPost("/predict",
Expand All @@ -32,4 +36,3 @@

// Run app
app.Run();