我正在遵循这份文档,但是遇到了一些困难:
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>
页面?