-
The way configuration collections such as Routes are currently mapped is as a list: "ReverseProxy": {
"Routes": [
{
"RouteId": "WebsiteRoute",
"Match": {
"Hosts": [ "localhost:4200" ]
}
},
{
"RouteId": "Route2"
}
]
} However, when overriding one of its underlying values with an environment variable, we'll have to name it as such:
I know this is a limitation of EnvironmentVariablesConfigurationProvider, which currently offers no way to index an array or list by any other way than an integer position. It would be way less error-prone however, and a lot clearer if we could just do this:
I'm thinking of a way to provide an alternative mapping, without breaking the way it currently works. Perhaps there's a way to provide the following mapping as an alternative, where the name of each direct descendant of "ReverseProxy": {
"Routes": {
"WebsiteRoute": {
"Match": {
"Hosts": [ "localhost:4200" ]
}
},
"Route2": {
}
}
} This would then allow the use of the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
#279 would address this if we decide to change the routes collection from an array to named objects. In the meantime take a look at this new sample: |
Beta Was this translation helpful? Give feedback.
#279 would address this if we decide to change the routes collection from an array to named objects.
In the meantime take a look at this new sample:
https://github.com/microsoft/reverse-proxy/pull/883/files#diff-9592b5ea7e975364e9ef73e6cf06df66ef4e4d08fdf16740fd9054169843ae79