How to load proxy configuration from both the configuration as from code? #516
-
I'm trying to combine loading configuration from both the configuration file (LoadFromConfig(..)) as from code (using the supplied "LoadFromMemory(..)" sample, but this is not working at all (routes from code are not loaded). Is this scenario supported (I want to create some "convention" based routing instead of doing a lot of configuration in the settings file)?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Only one source is currently supported. For convention based config we do have Will that work for you? |
Beta Was this translation helpful? Give feedback.
-
Probably not entirely ;) This solution will still require me to define all routes and clusters (in config) and then applying some "default" attributes on them, based on some condition. I'm more looking for a solution where I can say (in the config file): I have app1, app2 and app3 (which are frontend applications) and then create the correct routes and clusters in code (based on some custom code off course) and combine them with the existing (API endpoints etc) routes/clusters from the (same) config file. Is multiple configuration sources somewhere on the roadmap? |
Beta Was this translation helpful? Give feedback.
Only one source is currently supported.
For convention based config we do have
IProxyConfigFilter
that you can implement and have run on each provided cluster or route, either from code or config.reverse-proxy/samples/ReverseProxy.Config.Sample/CustomConfigFilter.cs
Lines 13 to 15 in 3832fd3
Will that work for you?