Skip to content
Merged
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
15 changes: 9 additions & 6 deletions TaleTrail.API/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading