twitchax / AspNetCore.Proxy

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

Is there a way to specify a path with a wildcard? #110

Closed DZFLUX closed 11 months ago

DZFLUX commented 11 months ago

I have a use case where I need to proxy any url that matches any path that starts with "api/reports". We use a reporting library we generates dynamic urls based on the definition of each report. I don't see any example of wildcards, I tried a couple of standard ones with but no luck.

proxies.Map("api/reports/", proxy => proxy.UseHttp("https://localhost:55555/api/reports/"));

Can we do something like this?

Thanks, Chad

twitchax commented 11 months ago

Yes, you can use the standard ASP.NET rest semantics.

https://github.com/twitchax/AspNetCore.Proxy#:~:text=You%20can%20%22catch%20all%22%20using%20ASP.NET%20**rest%20semantics.

DZFLUX commented 11 months ago

Sorry for the delayed response - this worked perfectly for me. thanks again