In a situation where you're building a single-page application (SPA) with a default index.html, which middleware ensures that the file is served when a user accesses the root URL?

  • UseDefaultFiles
  • UseStaticFiles
  • UseRouting
  • UseEndpoints
The UseDefaultFiles middleware is used to serve default files, like index.html, when a user accesses the root URL of a web application. This middleware ensures that the SPA's default page is served correctly. Make sure to include app.UseDefaultFiles(); in your Configure method.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *