diff --git a/Server/Program.cs b/Server/Program.cs index 2eb1ef5..cdc828e 100644 --- a/Server/Program.cs +++ b/Server/Program.cs @@ -70,6 +70,16 @@ if (app.Environment.IsDevelopment()) app.UseHttpsRedirection(); } +else if (app.Environment.IsProduction()) +{ + app.UseSwagger(); + app.UseSwaggerUI(c => + { + c.SwaggerEndpoint("/swagger/v1/swagger.json", "Optifit API v1"); + c.RoutePrefix = string.Empty; // Serve Swagger UI at the app's root + }); +} + app.UseHttpsRedirection(); app.UseAuthorization(); app.MapControllers();