diff --git a/TaleTrail.API/Program.cs b/TaleTrail.API/Program.cs index cb52be0..f90c176 100644 --- a/TaleTrail.API/Program.cs +++ b/TaleTrail.API/Program.cs @@ -33,15 +33,18 @@ // Configure middleware pipeline // ----------------------------------------- -// Enable Swagger only in development environment -if (app.Environment.IsDevelopment()) -{ - app.UseSwagger(); // Generate Swagger JSON - app.UseSwaggerUI(); // Serve Swagger UI -} +// ✅ Enable Swagger always (even in production for Render) +app.UseSwagger(); // Generate Swagger JSON +app.UseSwaggerUI(); // Serve Swagger UI + +// ✅ Add root test endpoint for Render health check or dev ping +app.MapGet("/", () => "📚 TaleTrail API is up and running!"); // Test route app.UseAuthorization(); // Add middleware for handling authorization app.MapControllers(); // Map controller routes to endpoints +// ✅ Make sure Render picks the correct port (8080) +app.Urls.Add("http://*:8080"); + app.Run(); // Run the application