diff --git a/src/dotnet/QuantEngine.Web/Program.cs b/src/dotnet/QuantEngine.Web/Program.cs index 63ceb94..5650161 100644 --- a/src/dotnet/QuantEngine.Web/Program.cs +++ b/src/dotnet/QuantEngine.Web/Program.cs @@ -37,10 +37,10 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); -// Collection Pipeline Services -builder.Services.AddScoped(); -builder.Services.AddScoped(); -builder.Services.AddScoped(); +// Collection Pipeline Services (using placeholder implementations for now) +builder.Services.AddScoped(); +builder.Services.AddScoped(); +builder.Services.AddScoped(); // HTTP Client & API Services builder.Services.AddHttpClient(); @@ -57,7 +57,13 @@ if (!app.Environment.IsDevelopment()) app.UseExceptionHandler("/Error", createScopeForErrors: true); app.UseHsts(); } -app.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: true); +// Redirect status code pages only for non-API routes +app.UseStatusCodePages(async ctx => +{ + if (!ctx.HttpContext.Request.Path.StartsWithSegments("/api")) + ctx.HttpContext.Response.Redirect("/not-found"); +}); + app.UseHttpsRedirection(); app.UseAntiforgery();