-
Notifications
You must be signed in to change notification settings - Fork 518
Asp.net Core 2 Razor Pages MapSpaFallback suggestion #1354
Comments
I have just been using a regex to exclude the api routes..... services
.AddMvc()
.AddRazorPagesOptions(options =>
{
options.Conventions.AddPageRoute("/Index", "{*url:regex(^(?!api).*$)}");
}); |
Thanks for the suggestion. In the next update, we're providing an alternative to
This is generic middleware that you can use either with MVC or Razor projects. Hopefully that will cover your requirements even more cleanly. |
@SteveSandersonMS That'd be awesome. On at least two of my projects, there's just a thin layer of razor over an index.html (generated by webpack). |
@buvinghausen thank you for your solution. I took me a long time to understand it but it works now. @SteveSanderson: when is this app.UseSpa avalible. With the newset version of .Net Core I don't have it yet :( |
@SteveSandersonMS also facing this issue still - is this an update we can expect soon? |
@jjgriff93 We shipped |
Hi , @jjgriff93 |
Thanks @SteveSandersonMS - turns out it was a completely unrelated problem to spaservices! It was an SSL error. @jfborie I'm probably not best placed to help as I'm fairly new with the framework myself; however if you post your issue up separately and reference it I'm happy to take a look and see if i have any suggestions. Make sure you tell us what the error is with any code you can share |
I hit too many snag i am trying with https://github.com/angular/universal-starter for now. Thx. |
MapSpaFallback works well for MVC routes but does not exist for the new Razor Pages.
If SpaRouteConstraint were
public
instead ofinternal
with a little work developers can add the constraint to Razor pages:Would be even better if
JavaScriptServices
somehow addedSpaRouteConstraint
to theConstraintMap
.For now I'll just copy the
SpaRouteConstraint
class.Thanks,
Philip
The text was updated successfully, but these errors were encountered: