UseStaticFiles adds static-file middleware to an ASP.NET Core request pipeline. The middleware checks the wwwroot folder and returns a requested file when it exists. section 4.2.2
Minimal static-file pipeline
Create the application, build it, add static-file middleware, and run it: WebApplicationBuilder builder = WebApplication.CreateBuilder(args); WebApplication app = builder.Build(); app.UseStaticFiles(); app.Run(); A request for /moon.jpg is served from wwwroot/moon.jpg. A request for a missing file passes through and produces a 404 response. No services are required for this pipeline. section 4.2.2

