how to create single proxy for multiple api2 controller

Not applicable

Hi

i am using API2 service, i am having more than one controller defined, is it possible to have a single proxy for the all the controller methods.

Examples:

http://dev.test.com/MyAPI2/controller1/getnames

http://dev.test.com/MyAPI2/controller2/getcities

http://dev.test.com/MyAPI2/controller2/getstates

Apigee proxy url i am in need of for the above is like

http://test.apigee.net/MyAPI2/

in my code i will use this as base path and use the controller name and method name dynamically in suitable place.

0 2 207
2 REPLIES 2

@santhosh kumar Wecome to Apigee Community.

Yes, It's possible. Have you tried creating proxy ? Are you stuck ? What exactly are you looking for ?

yep, what Anil said.

Just some additional comment. The API proxy by default is a pass-through. Which means you can configure it to listen at sathosh-test.apigee.net , and then it will connect to your backend (like maybe mybackend.example.com). IF the inbound call is

http://sathosh-test.apigee.net/MyAPI2/controller1/getnames

..then Apigee Edge will invoke

http://mybackend.example.com/MyAPI2/controller1/getnames

You can fiddle with Apigee Edge to do "url rewriting" or "routing" and so on. In other words the Proxy would then not be a straight pass-through. But in your case it probably wouldn't be necessary to do this.

The key issue for Apigee Edge proxies is URL paths and hostnames, not controllers. Apigee Edge has no knowledge of your backend implementation, and needs none. It just proxies requests arriving at the inbound URL path to another location, possibly at the same URL path but a different hostname.