Class BowireEndpointRouteBuilderExtensions
- Namespace
- Kuestenlogik.Bowire
- Assembly
- Kuestenlogik.Bowire.dll
ASP.NET routing extensions for mounting the Bowire multi-protocol API workbench onto an IEndpointRouteBuilder.
public static class BowireEndpointRouteBuilderExtensions
- Inheritance
-
BowireEndpointRouteBuilderExtensions
- Inherited Members
Remarks
MapBowire() adds the workbench's UI assets and JSON API under a
single route prefix. Pair it with
AddBowire(IServiceCollection)
in Program.cs so installed protocol plugins are auto-registered
before the endpoint is mapped.
The workbench supports gRPC, REST/OpenAPI, SignalR, WebSocket, SSE, MCP, MQTT, GraphQL, OData and Socket.IO — every protocol whose plugin NuGet is referenced in your project.
Methods
MapBowire(IEndpointRouteBuilder, Action<BowireOptions>)
Maps the Bowire workbench at the default /bowire route,
with the given configuration callback.
public static IEndpointRouteBuilder MapBowire(this IEndpointRouteBuilder endpoints, Action<BowireOptions> configure)
Parameters
endpointsIEndpointRouteBuilderThe endpoint route builder to attach to.
configureAction<BowireOptions>Callback to customise the BowireOptions. Required overload — use MapBowire(IEndpointRouteBuilder, string, Action<BowireOptions>?) if you don't need to configure anything.
Returns
- IEndpointRouteBuilder
The same
endpointsinstance, so calls can be chained.
Examples
app.MapBowire(options =>
{
options.Title = "Orders service";
options.ServerUrls.Add("https://orders:443");
});
MapBowire(IEndpointRouteBuilder, string, Action<BowireOptions>?)
Maps the Bowire workbench at the given route prefix.
public static IEndpointRouteBuilder MapBowire(this IEndpointRouteBuilder endpoints, string pattern = "/bowire", Action<BowireOptions>? configure = null)
Parameters
endpointsIEndpointRouteBuilderThe endpoint route builder to attach to.
patternstringURL path prefix for the workbench. Defaults to
/bowire. Must start with a slash. A trailing slash is optional.configureAction<BowireOptions>Optional callback to customise the BowireOptions (title, theme, discovery URLs, proto sources, …).
Returns
- IEndpointRouteBuilder
The same
endpointsinstance, so calls can be chained.
Examples
Zero-config mount (gRPC server with Server Reflection enabled):
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddBowire();
var app = builder.Build();
app.MapBowire(); // UI + API at /bowire
With proto import (no reflection needed):
app.MapBowire(options =>
{
options.ProtoSources.Add(ProtoSource.FromFile("protos/weather.proto"));
});
Custom route, title and theme:
app.MapBowire("/tools/api", options =>
{
options.Title = "Payments API";
options.Theme = BowireTheme.Light;
});
Remarks
The value of RoutePrefix set inside
configure is overwritten by pattern
— the pattern parameter is always authoritative.