I am working on an ASP.NET Core website (formerly called ASP.NET 5 / vNext) with Angular. In order for Angular to work, I need to have the entire route:
app.UseStaticFiles();
app.UseMvc(routes =>
{
routes.MapRoute("angular", "{*url}", new { controller = "Home", action = "Index" });
});
I also have several files / folders in wwwroot, for example:
wwwroot/app
wwwroot/assets
wwwroot/lib
If any requests are made to these paths, for example http://example.com/assets/css/test.css, and the file ( test.css) DOES NOT exist, it should not continue the backup route. He must return 404.
Right now, if the file does not exist, it returns Angular HTML. So, how can I say that any path starting with '/ assets' should only be routed / served UseStaticFiles?
Thank.