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.
Loading...
Related Quiz
- Your web application needs to provide different access levels, such as "Admin," "User," and "Guest." Which ASP.NET Core Identity feature would be crucial for implementing this?
- The asp-action attribute in a Razor form specifies the _________ to which the form will be submitted.
- What is the primary difference between the _ViewImports.cshtml and _ViewStart.cshtml files in Razor?
- What is the primary purpose of using attribute routing in ASP.NET Core?
- In an online quiz application, you want to ensure that only teachers can create or edit questions. Which attribute in ASP.NET Core will help you achieve this functionality?