See the FallbackRoute in the new .NET Core 2.0 SPA Templates.
[FallbackRoute("/{PathInfo*}")]
public class FallbackForClientRoutes
{
public string PathInfo { get; set; }
}
public class MyServices : Service
{
//Return index.html for unmatched requests so routing is handled on client
public object Any(FallbackForClientRoutes request) =>
new PageResult(Request.GetPage("/"));
}
Also your index.html Template can call Services, other filters, etc.