Found the answer here: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/map-static-files?view=aspnetcore-9.0
I needed to use UseStaticFiles() in my program.cs.