From affolternet-web-api
Configure affolterNET.Web.Api service registration and middleware pipeline. Use when setting up AddApiServices, ConfigureApiApp, or configuring the API middleware order.
How this skill is triggered — by the user, by Claude, or both
Slash command
/affolternet-web-api:api-setupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Configure the affolterNET.Web.Api service registration and middleware pipeline.
Configure the affolterNET.Web.Api service registration and middleware pipeline.
For complete reference, see Library Guide.
// Program.cs
var builder = WebApplication.CreateBuilder(args);
// Step 1: Register services
var options = builder.Services.AddApiServices(
builder.Environment.IsDevelopment(),
builder.Configuration,
opts => {
opts.EnableSecurityHeaders = true;
opts.ConfigureApi = api => {
api.AuthMode = AuthenticationMode.Authorize;
};
});
var app = builder.Build();
// Step 2: Configure middleware
app.ConfigureApiApp(options);
app.Run();
| Property | Type | Description |
|---|---|---|
EnableSecurityHeaders | bool | Enable security headers middleware |
ConfigureApi | Action | Configure API-specific options |
ConfigureAfterRoutingCustomMiddleware | Action | Add custom middleware after routing |
ConfigureBeforeEndpointsCustomMiddleware | Action | Add custom middleware before endpoints |
| Property | Type | Default | Description |
|---|---|---|---|
AuthMode | AuthenticationMode | None | Authentication mode (None/Authenticate/Authorize) |
The ConfigureApiApp configures middleware in this order:
var options = builder.Services.AddApiServices(
builder.Environment.IsDevelopment(), // isDev flag
builder.Configuration,
opts => {
// Development-specific config happens automatically
// based on isDev flag
});
var options = builder.Services.AddApiServices(isDev, config, opts => {
opts.ConfigureAfterRoutingCustomMiddleware = app => {
app.UseMiddleware<RequestLoggingMiddleware>();
};
opts.ConfigureBeforeEndpointsCustomMiddleware = app => {
app.UseMiddleware<TenantMiddleware>();
};
});
npx claudepluginhub affolternet/affolternet.web --plugin affolternet-web-apiDevelops ASP.NET Core APIs with minimal APIs, controllers, middleware, OpenAPI/Swagger, endpoint groups, filters, rate limiting, and output caching.
Custom middleware patterns for ASP.NET Core applications. Covers request/response pipeline, middleware ordering, conditional middleware, IMiddleware factory pattern, IExceptionHandler (.NET 8+), and reusable middleware components. Use when creating custom middleware in ASP.NET Core applications, understanding middleware pipeline ordering, or implementing cross-cutting concerns like logging, authentication, and caching.
Secures ASP.NET Core Web API endpoints with JWT Bearer token validation and Auth0 integration. Handles DPoP proof-of-possession binding.