-
I read this some place but can't remember. My questions is, what about an XML config outside of the conventional appSettings.json. I can watch the file for changes but wondering how I can make YARP bind to any route changes if an XML config is changed? There is this documentation but not very clear: Any examples, or reference is highly appreciated. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
How are you binding to the xml the first time? |
Beta Was this translation helpful? Give feedback.
-
@Tratcher Like this:
Call it like this in program.cs: |
Beta Was this translation helpful? Give feedback.
Ok. Take a look at how we read the appsettings.json and listen for changes:
https://github.com/microsoft/reverse-proxy/blob/3a5a68fac3bccbcf19e785a82497abf4b1c30053/src/ReverseProxy/Configuration/ConfigProvider/ConfigurationConfigProvider.cs#L52-L62
You should be able to do something similar with FileSystemWatcher.
https://learn.microsoft.com/en-us/dotnet/api/system.io.filesystemwatcher?view=net-7.0