Request Method - Local Testing

Hi team,

We are developing a custom app that makes API calls using the correct request method. These API requests often take more than 5 seconds so we successfully requested to increase the timeout of our app to 10 seconds (thank you).

However, we are still timing out when testing locally. How can we increase our timeout limit locally?

Thank you

I have a very cumbersome workaround for you.

Navigate to the global node modules directory — Stright to the local FDK’s source.

# On Mac 
~
❯ cd /usr/local/lib/node_modules/fdk/lib/api

# Open Proxy.js
/usr/local/lib/node_modules/fdk/lib/api
❯ open proxy.js

In the proxy.js file,

const MAX_RETRY_DELAY = 1500;
const MIN_RETRY_DELAY = 0;
const REQUEST_TIMEOUT = 5000; // Change this to 10000
const RETRY_STRATEGY = request.RetryStrategies.HTTPOrNetworkError;

Save the file and close it.

Next time you run fdk run, this version of fdk will be used. Also, do not forget to reset, because it might affect all projects that you work with fdk.

A ideal way would be to make local testing for the request method timeout configurable by passing flag such as

fdk run --request-timeout=10

But this is not the case today.

1 Like

@Henry_Kremer

Hello. Believing that these requests are made in server.js, you can choose to use external libs like axios / got. If you own the third-party API s/ service, the best option is to optimize its performance of it / split it into multiple APIs. That way you can continue using our request module and get benefited

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.