<分区>
我正在关注这个文档,但我被卡住了: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files
考虑我的目录结构:
wwwroot
dist
index.html
在我的创业课上,我有:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "dist"))
});
}
当我启动该应用程序时,我没有看到我的 index.html 页面,但如果我导航到 <host>/dist/index.html
,我会看到
我如何配置它以便 ASP.NET 自动将我从 <host>
转到该页面?