📅  最后修改于: 2022-03-11 14:49:03.395000             🧑  作者: Mango
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");
});
}
}