Near the upper left hand corner of the API Gateway, under Assertions, expand Policy Assertions > Message Routing, and select one of the "Route via" assertions. In this example, we will look at the Route via HTTP(S) assertion.
You would drag the "Route via" assertion into the service. In this example, the myApp service will route requests to http://www.example.com/myApp.
In this example, since the myApp service only contains the Route via HTTP assertion, requests will always be routed to www.example.com/myApp. In other words, the request will never be rejected. If the hostname of your API Gateway is www.apig.com, you would use www.apig.com/myApp to route the request into the myApp service in the API Gateway, and the myApp service will route the request onto www.example.com/myApp.
If the service should route to two or more backends, such as a clustered application server, you can then double-click on the Route via HTTP(S) assertion, select the Connection tab, select Use multiple URLs, and listed each URL that the request can route to.