Friday 5 May 2017

Timeout when running web app in Heroku - fine when running locally

I'm an iOS developer by trade so please forgive me for my doubt no ignorant question...

I have a web app that is being deployed to heroku, I have a package installed (GetVideo), and I'm making a call to my /video?url=xxx endpoint to retrieve the URL for a video. Works absolutely fine locally (if a little slow - 1000ms). When I deploy this app, and make the some call to Heroku I get this timeout error:

at=error code=H12 desc="Request timeout" method=GET path="

Which is odd.

Here is the code used for the endpoint, very basic.

app.get('/video', (req, response) => {
  var url = req.query.url;
  getVideo(url, function(err, video) {
        if (err) {
          response.status(500).send(err.message);
        } else {
          response.send({video})
      }
    });
})

Any suggestions to stop the error?



via spogebob92

No comments:

Post a Comment