I'm using ASP.NET Core to serve an SPA like this:
[<Route("{*url}")>]
member this.Index () =
this.View("~/wwwroot/Index.cshtml")
My JSON endpoints are on the same app, routed like this:
[<Route("api/something/{somethingId:int})>]
This works fine, except that when I try to call an endpoint api/something/that/doesnt/exist
I get the index page when I actually want a 404.
Is it possible to setup [<Route("{*url}")>]
in such a way that it excludes any url that starts with "api"?