-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Proxied Request Path Configurable #5
Comments
Thank you for the suggestion. Not sure if it's better to add a parameter to the |
My opinion would be that it'd be better to add it to MapSpaYarp, since it seems to me that ideally SpaDevelopmentServerOptions could stay in sync with the "real" version that's actually in aspnetcore. As I mentioned in my other ticket, I've removed SpaYarp and have basically replicated most of what it does - here's how I am now configuring the endpoints:
Thanks for creating this library - even if I'm not using it directly now, it was how I learned about Yarp and showed me how to solve this issue :) |
I've made a pull request that introduces SpaDevelopmentServerOptions.PublicPath option which corresponds to devServer.publicPath option of Webpack Dev Server. |
@buchatsky thank you for the PR, I merged it. |
There may be some use cases when a single redirect path is not enough. For ex. when several SPAs are launched from different Razor views. So, semicolumn-delimited lists with wildcards would be more suitable |
@berhir @buchatsky does it make sense to allow custom yarp configuration file for full customization instead of the predefined routes? In the real world applications, we usually have more than one cluster and routes. ex: a signalr route, a spa route, and an api route) example: .AddReverseProxy()
.LoadFromConfig(configuration.GetSection("ReverseProxy")); |
Hello for me using I belive this |
@danmunteanuevo please see #17. a new version that fixes this issue will be published soon |
I haven't been able to fully test this yet (as per my other issue) but from reading the code, I think that the line the line
endpoints.Map("/{**catch-all}"
inIEndpointRouteBuilderExtensions
would make it so the .Net application itself can't have a "catch all" handler - which is I think a relatively common requirement.I need to be able to have only certain requests proxied - e.g. those starting with
/dist/
and other paths specific to the hot reloading features of Webpack. That would let the .Net application handle all other requests, including not matched ones.I'm thinking that
MapSpaYarp
should at very least accept the string pattern as a parameterThe text was updated successfully, but these errors were encountered: