Problems hitting REST services when running App on Node.js server

3205
3
06-18-2015 02:48 PM
GerardoGarza
New Contributor III

Has anyone had any problems with the node server used for running web appbuilder?

I run the node windows service on my local development machine so I can both make changes through web app builder and test the app quickly without having to deploy.  While testing a query tool, I repeatedly received timeout errors when making the query call to the REST service.   I could hit it a few times with no problem.  As soon as it would get a timeout, then most of my queries would result in timeouts as well as calls to the print service.  I tried various things like rebuilding indexes on the layer, restarting the windows service, checking server logs, running the queries on the rest service page and stepping through the code but could not figure out the issue.  However, when I deployed and tested the app on an IIS server, the app ran smoothly and I did not have any timeouts.  Since nothing else I tried worked, I am assuming it is the node service but am open to any suggestions.  Thanks.

0 Kudos
3 Replies
JunshanLiu
Occasional Contributor III

Could you inspect your network request to check whether the REST call uses proxy (proxy.js)? I think maybe this is caused by proxy's timeout setting. The proxy.js default timeout 20 seconds, or you can change the timeout setting in server/proxy.js file to have a test.

0 Kudos
GerardoGarza
New Contributor III

The app is using proxy.js, however, the call is hitting the timeout of the REST service itself running on ArcGIS server which is one minute.  On your hunch, I completely removed the proxy section from the config.json and I cannot get the queries to timeout.  I was trying to substitute another proxy, but cannot get the settings right since I am using the windows service.  Looks like it may be the proxy, but where do I change the proxy timeout?  I could not find it.  Thanks for your help.

0 Kudos
JunshanLiu
Occasional Contributor III

In proxy.js file, add a new property to requestParams variable like this:

{

     ...

     timeout: 1000000

}

From here you can get details about this parameter:

request

Hope this works for you!