Configure affolterNET.Web.Api service registration and middleware pipeline. Use when setting up AddApiServices, ConfigureApiApp, or configuring the API middleware order.
Configures affolterNET.Web.Api service registration and middleware pipeline. Use when setting up AddApiServices, ConfigureApiApp, or configuring middleware order in Program.cs.
/plugin marketplace add Mcafee123/affolterNET.Web/plugin install affolternet-web-api@affolternet-webThis skill inherits all available tools. When active, it can use any tool Claude has access to.
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<ApiOptions> | Configure API-specific options |
ConfigureAfterRoutingCustomMiddleware | Action<IApplicationBuilder> | Add custom middleware after routing |
ConfigureBeforeEndpointsCustomMiddleware | Action<IApplicationBuilder> | 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>();
};
});
Configure Static Application Security Testing (SAST) tools for automated vulnerability detection in application code. Use when setting up security scanning, implementing DevSecOps practices, or automating code vulnerability detection.