SampleArtifacts/policy.xml (18 lines of code) (raw):
<!--
IMPORTANT:
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements.
- Only the <forward-request> policy element can appear within the <backend> section element.
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element.
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element.
- To add a policy position the cursor at the desired insertion point and click on the round button associated with the policy.
- To remove a policy, delete the corresponding policy statement from the policy document.
- Policies are applied in the order of their appearance, from the top down.
-->
<policies>
<inbound>
<cors allow-credentials="false">
<allowed-origins>
<origin>{{environment}}</origin>
</allowed-origins>
<allowed-methods>
<method>GET</method>
<method>POST</method>
</allowed-methods>
</cors>
</inbound>
<backend>
<forward-request />
</backend>
<outbound />
<on-error />
</policies>