twitchax / AspNetCore.Proxy

ASP.NET Core Proxies made easy.
MIT License
524 stars 83 forks source link

Is it possible to use typical dynamic route parameters for the proxy maps? #74

Closed aderderian closed 3 years ago

aderderian commented 3 years ago

For example, proxies.Map("{clientid}/api/{endpoint}", proxy => proxy.UseHttp((context, args) => ........

Does it only resolve {endpoint} as a dynamic route element?

twitchax commented 3 years ago

What do you mean by "only...as a dynamic route element"?

aderderian commented 3 years ago

I meant {endpoint} was a reserved token and it only resolved that, or can it work with other placeholders like {xyz} and {xyz?}. In short, does it follow .net core endpoint routing standards?

twitchax commented 3 years ago

Ahhhh: good question!

Yes, it uses all of the same routing mechanics. Actually, it just calls MapMiddlewareRoute, and passes the route into that. :)

See here.