Skip to content

Services to generate relative route in runtime for specified cluster and path #2848

Answered by MihaZupan
tvardero asked this question in Q&A
Discussion options

You must be logged in to vote

You might find RequestUtilities.MakeDestinationAddress helpful for the concat part.

Assuming you're trying to get the base Url based on the route match, I'm not sure there's something built-in that would go in reverse and generate a Url that would match a given route.
If you have a pattern of setting up routes in a similar way, you could consider looking for the PathRemovePrefix transform instead, maybe saving yourself from dealing with wildcards.

Re: IProxyConfigProvider, you might find using IProxyStateLookup easier (resolve it from DI) to look through routes/clusters.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MihaZupan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants