@Abhinav Tata Thanks for reaching out.
You can either define the Template parameters in the frontend which will accept any string value as below and leverage the rewrite-uri policy to route to different backend URLs based on your input url for your name parameter
<rewrite-uri template="@{
var url = context.Request.OriginalUrl.Path;
if (url.Contains("/important"))
{
return url.Replace("/rest/important", "/important-backend-url");
}
else if (url.Contains("/notimportant"))
{
return url.Replace("/rest/notimportant", "/notimportant-backend-url");
}
else
{
return url;
}
}" />
Yes, alternatively you can also define two different operation to route to different backend url.
Let me know if you have any queries or concerns.
Follow Up query resolution:
You have to use /rest/* in my template parameter to dynamically have any number of sub-entities being passed as request. Accordingly, you parsed the necessary portion out of context.Request.Url.Path to your variable and used it for your case.
This was the answer - using /rest**/***
Please 'Accept Answer' if it helped so that it can help others in the community looking for help on similar topics.