我正在使用VNext + OSX + Chrome进行一些实验。 我试图获得一个woff2文件。
GET http://localhost:5003/fonts/fontawesome-webfont.woff2?v=4.3.0
但出现了一个错误。请查看以下请求的标题。
Remote Address:127.0.0.1:5003
Request URL:http://localhost:5003/fonts/fontawesome-webfont.woff2?v=4.3.0
Request Method:GET
Status Code:404 Not Found
这是我的 Startup.cs 文件
public void Configure(IApplicationBuilder app)
{
app.UseStaticFiles();
app.UseServices(services =>
{
services.AddMvc();
});
// Add MVC to the request pipeline
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller}/{action}/{id?}",
defaults: new { controller = "Home", action = "Index" });
});
}
我在Github上看到了AspNet项目关于StaticFiles的内容(下面是链接),看起来它得到了支持。
你们能给我一些帮助吗?