ApiReferenceRewriteMiddleware Pennington.DocSite.Api
Rewrites inbound request paths under any configured public RoutePrefix onto the internal /_pnn_api/{Name}/... shape that ApiReferencePage.razor matches. Runs before Blazor's router so the component sees a stable route template regardless of how the caller configured the public URL.
Constructors
.ctor
#public ApiReferenceRewriteMiddleware(RequestDelegate next, ApiReferenceRegistrationRegistry registry);Initializes the middleware.
Parameters
nextRequestDelegateregistryApiReferenceRegistrationRegistry
Methods
InvokeAsync
#public Task InvokeAsync(HttpContext context);Handles the rewrite; forwards to the next middleware either way.
Parameters
contextHttpContext
Returns
TaskPennington.DocSite.Api.ApiReferenceRewriteMiddleware
namespace Pennington.DocSite.Api;
/// Rewrites inbound request paths under any configured public RoutePrefix onto the internal /_pnn_api/{Name}/... shape that ApiReferencePage.razor matches. Runs before Blazor's router so the component sees a stable route template regardless of how the caller configured the public URL.
public class ApiReferenceRewriteMiddleware
{
/// Initializes the middleware.
public ApiReferenceRewriteMiddleware(RequestDelegate next, ApiReferenceRegistrationRegistry registry);
/// Handles the rewrite; forwards to the next middleware either way.
public Task InvokeAsync(HttpContext context);
}