My node js application on apigee always redirects to error page

Not applicable

Hi,

I have created a proxy for node.js application using Node.js app option. I deployed the application through command line which was successful. But whenever I hit the newly created proxy URL <http://lntorg-test.apigee.net/v1/consumer-profiles>, it redirects me to error page. Here is my proxy endpoint file proxy-endpoints.txt and target endpoint file target-endpoints.txt. I have tested the node.js application and it is working fine in my local environment. Also deployment was done through local environment.Please help me out with this issue

Solved Solved
0 4 187
1 ACCEPTED SOLUTION

Not applicable

Hi @Saba, Could you please verify the URL you are accessing. In your proxy endpoint you have added proxy base path as <BasePath>/fetch/consumer-profiles</BasePath>. So your base url will be:

http://lntorg-test.apigee.net/fetch/consumer-profiles and then any path in your node app.

View solution in original post

4 REPLIES 4

Not applicable

Hi @Saba, Could you please verify the URL you are accessing. In your proxy endpoint you have added proxy base path as <BasePath>/fetch/consumer-profiles</BasePath>. So your base url will be:

http://lntorg-test.apigee.net/fetch/consumer-profiles and then any path in your node app.

I have deployed same app with different urls one is </v1/consumer-profiles> while another is </fetch/consumer-profiles>. Just to clarify do i have to run the generated proxy url or append some url to this proxy url. eg. if i have written a route for fetch/consumer-profiles then what would be URL that i need to hit.

In proxy, basepath along with your host name maps to target endpoint.

In your case http://lntorg-test.apigee.net/fetch/consumer-profiles maps to your node app end point.

If you want to access any resource on target it will come after this complete url. So you need to access http://lntorg-test.apigee.net/fetch/consumer-profiles/fetch/consumer-profiles.

similarly for http://lntorg-test.apigee.net/v1/consumer-profiles/fetch/consumer-profiles.

Use different keywords in basepath along with versioning. Also try avoiding use of verbs in rest endpont like fetch.

Make sure you access node something as "localhost:port/fetch/consumer-profiles "

I tried accessing <http://lntorg-test.apigee.net/v1/consumer-profiles/fetch/consumer-profiles> as well as <http://lntorg-test.apigee.net/fetch/consumer-profiles/fetch/consumer-profiles> but it shows page currently unavailable. Also is it possible to access intranet node service through apigee. I dont want to deploy my entire application on apigee its going to scale a lot i just want to proxy my service urls. is that possible?