I have 3 operation in my proxy
GET - /users/{userId}
POST - /users
DELETE - /users/{userId}
Each of these operations needs to call 3 different target end points
GET - https://host/api/mobileapps/getUser
POST - https://host/api/mobileapps/createUser
DELETE - https://host/api/mobileapps/deleteUser
When I set the TargetEndpoint as follows:
<HTTPTargetConnection>
<Properties/>
<URL>hhttps://host/api/mobileapps</URL>
</HTTPTargetConnection>
For each flow above, I can have a JS policy in my target end point, get the targetUrl using target.url flow variable. Append the target operation (getUser or createUser or deleteUser) to the target.url to hit the back end and get the response.
This approach works !!
Now what I am trying is to set the Target URL as Target Server
TargetServer name="target1">
<Host>host</Host>
<Port>443</Port>
<IsEnabled>true</IsEnabled>
<SSLInfo>
<Enabled>true</Enabled>
</SSLInfo>
</TargetServer>
In my Target end point:
<HTTPTargetConnection>
<Properties/>
<LoadBalancer>
<Server name="target1"/>
</LoadBalancer>
<Path>/api/mobileapps</Path>
</HTTPTargetConnection>
For each operation, how do I update the target.url as target.url flow variable does not work with Target server configurations (as discussed here)
Is there another approach ? I want to use Targetserver instead of URL so that is completely configuration based.