Wire SquidStd into an ASP.NET Core Minimal API and expose its health checks over HTTP.
A Minimal API web app that uses SquidStd (SquidStd.AspNetCore) as its DryIoc-backed service provider, surfaces
the registered SquidStd health checks at /health, and answers a simple root endpoint.
- .NET 10 SDK
dotnet add package SquidStd.AspNetCore
UseSquidStd swaps in DryIoc as the ASP.NET Core service provider and bootstraps SquidStd. The root directory is
taken from the host environment automatically, so you only set the config name.
AddSquidStdHealthChecks registers every SquidStd IHealthCheck as a standard ASP.NET Core health check. Call it
after UseSquidStd.
Build the app, expose the health checks with the standard MapHealthChecks, add a root endpoint, and run.
Add AddSquidStdSerilog() to send ASP.NET Core framework logs (Kestrel, Microsoft.Hosting.Lifetime)
through the same Serilog logger SquidStd configures from squidstd.yaml, giving a single format and a
single configuration source:
builder.UseSquidStd(options => options.ConfigName = "squidstd");
builder.AddSquidStdSerilog();
builder.AddSquidStdHealthChecks();Without this call the two loggers stay separate (two console formats). With it, squidstd.yaml drives
all logging.
dotnet run --project samples/SquidStd.Samples.AspNetCoreBrowse to / for the "SquidStd up" message and to /health for the aggregated health-check status.
UseSquidStd creates an owned DryIoc container, registers it through DryIocServiceProviderFactory, and hooks the
SquidStd lifecycle into the ASP.NET Core host via a hosted service. AddSquidStdHealthChecks resolves the SquidStd
IHealthCheck instances from that container and adapts each one into the standard health-check pipeline, so
MapHealthChecks reports them like any other ASP.NET Core check.
- SquidStd.AspNetCore reference
- Previous: Getting started