Question: I have a node.js GET API endpoint that calls some backend services to get data.

```
app.get('/request_backend_data', function(req, res) {

   ---------------------
}

```

When there is a delay getting a response back from the backend services, this endpoint(request\_backend\_data) is getting triggered exactly after 2 minutes. I have checked my application code, but there is no retry logic written anywhere when there is a delay.
Does node.js API endpoint gets called twice in any case(like delay or timeout)?

Answer: 
There might be a few reasons:

* some chrome extensions might cause bugs. Those chrome extensions have been causing a lot of issues recently. run your app on a different browser. If there is no issue, that means it is chrome-specific problem.
* express might be making requests for favicon.ico. In order to prevent this, use this module : <https://www.npmjs.com/package/serve-favicon>
* add CORS policy. Your server might sending preflight requests Use this npm package: <https://www.npmjs.com/package/cors>
Try checking the api call with the code below, which includes follwing redirects. Add headers as needed (ie, `'Authorization': 'bearer dhqsdkhqd...etc'`

```
var https = require('follow-redirects').https;
var fs = require('fs');

var options = {
  'method': 'GET',
  'hostname': 'foo.com',
  'path': '/request_backend_data',
  'headers': {
  },
  'maxRedirects': 20
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function (chunk) {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });

  res.on("error", function (error) {
    console.error(error);
  });
});

req.end();

```

Paste into a file called test.js then run with `node test.js`.