using Microsoft.Extensions.FileProviders; var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); app.MapGet("/", () => "Hello World!"); app.UseStaticFiles( new StaticFileOptions { FileProvider = new PhysicalFileProvider( Path.Combine(builder.Environment.ContentRootPath, "Images")), RequestPath = "/images" } ); app.Run();