I have asp.net mvc6 project. On client side i want to use angular2 to create single page application. It means i have two places where i can define routing. As far it's SPA, routing has to be on angular2 side, but how to deal in case when user is refreshing page? MVC returns 404.
One way would be to set Startup route in mvc6:
routes.MapRoute(
name: "spa-fallback",
template: "{*url}",
defaults: new { controller = "OAuth", action = "Index" });
});
And then controller gives Request.Path to angular2.
However this {*url} does not recognize *.map and other static files. Also there may be scenarious where i would like to use static page like Error.html etc.
Is there any better way to deal with routing on both (server/client) side?