Back to Practical Aspnetcore

WebApplication - UseFileServer()

projects/minimal-hosting/web-application-use-file-server/README.md

latest594 B
Original Source

WebApplication - UseFileServer()

This sample uses the brand new WebApplication hosting class. app.UseFileServer(); enables Kestrel to server static files and automatically look for the following files

  • default.htm
  • default.html
  • index.htm
  • index.html

at wwwroot.

You can read the implementation of WebApplication here and its sibling WebApplicationBuilder here