From 74b9411ff1f9ef18c344ff1085b1c51ccb46f308 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 9 Nov 2025 16:01:09 +0000 Subject: [PATCH] fix: Enable Swagger API documentation in all environments - Remove Development-only restriction on Swagger/SwaggerUI - Explicitly set Swagger route prefix for clarity - Swagger is now accessible at http://localhost:5000/swagger (API port) Note: Access Swagger directly on the API endpoint (port 5000), not through the frontend client (port 8080), as the Blazor routing would intercept it. --- src/Backend/VanDaemon.Api/Program.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Backend/VanDaemon.Api/Program.cs b/src/Backend/VanDaemon.Api/Program.cs index c6cc218..1f4e2bc 100644 --- a/src/Backend/VanDaemon.Api/Program.cs +++ b/src/Backend/VanDaemon.Api/Program.cs @@ -73,11 +73,13 @@ } // Configure the HTTP request pipeline -if (app.Environment.IsDevelopment()) +// Enable Swagger in all environments for API documentation access +app.UseSwagger(); +app.UseSwaggerUI(c => { - app.UseSwagger(); - app.UseSwaggerUI(); -} + c.SwaggerEndpoint("/swagger/v1/swagger.json", "VanDaemon API v1"); + c.RoutePrefix = "swagger"; // Explicitly set the route prefix +}); app.UseCors("AllowAll"); app.UseAuthorization();