UseTraxDashboard
Maps the Trax.Core Dashboard Blazor components at the configured route prefix. Call this after app.Build() during application startup.
Signature
public static WebApplication UseTraxDashboard(
this WebApplication app,
string routePrefix = "/trax",
string? title = null
)Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
routePrefix | string | No | "/trax" | URL prefix where the dashboard is mounted. Leading/trailing slashes are normalized. |
title | string? | No | null | Overrides the dashboard title. null keeps the title from DashboardOptions. |
Returns
WebApplication — for continued middleware chaining.
Example
var app = builder.Build();
app.UseTraxDashboard(
routePrefix: "/admin/trains",
title: "Order Processing Dashboard");
app.Run();The dashboard will be accessible at https://yourapp/admin/trains.
What It Configures
UseStaticFiles()— serves static assets (CSS, JS)UseAntiforgery()— CSRF protection for Blazor formsMapStaticAssets()— maps static web assets from the dashboard RCLMapRazorComponents<App>().AddInteractiveServerRenderMode()— maps Blazor components with Interactive Server rendering
Remarks
- Must be called after
builder.Build()and beforeapp.Run(). - The
routePrefixis normalized:"trax","/trax", and"/trax/"all resolve to"/trax". - The dashboard requires a data provider (UsePostgres or UseInMemory) to be configured for metadata and manifest pages to function.