Stellen Sie die benutzerdefinierte Standarddatei im Start ein
public class Startup
{
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
//Specify the MyCustomPage1.html as the default page
DefaultFilesOptions defaultFilesOptions = new DefaultFilesOptions();
defaultFilesOptions.DefaultFileNames.Clear();
defaultFilesOptions.DefaultFileNames.Add("MyCustomPage1.html");
//Setting the Default Files
app.UseDefaultFiles(defaultFilesOptions);
//Adding Static Files Middleware to serve the static files
app.UseStaticFiles();
app.Run(async (context) =>
{
await context.Response.WriteAsync("Request handled by the terminating middleware");
});
}
}
Stalwart King