0

I am using RPlumber to create an API that makes some data available to the users of the API. I created an Ubuntu 16.04 server on Linode to host the API.

I have successfully installed R on the server, and all of the libraries, and am able to run the script on the machine with command Rscript file_that_runs_rplumber.R. When I run the script, the command line hangs with:

Running plumber API at http://0.0.0.0:8004
Running swagger Docs at http://127.0.0.1:8004/__docs__/

...so I know that the API is successfully running. I am trying to hit this endpoint from my local machine, not from the Linode server, and so I replace the 0.0.0.0 with my IP address 1.2.3.4 lets say. When I visit 1.2.3.4:8008/__docs__/, this page does work, and I get the auto-generated RPlumber API docs:

enter image description here

However when I replace /__docs__/ with one of the API's endpoints, I receive the following:

enter image description here

I can see from the command line for the Linode Server that the R code associated with the endpoint is running, however it is simply not being returned to me. Perhaps this is a security issue, that I cannot access the endpoint on my local machine? How can I update the server so that my local machine (and any other machines as well) can access this API?

Thanks!

Canovice
  • 9,012
  • 22
  • 93
  • 211
  • The api is responding, there is an error occuring within your endpoint function/handle. This is not a 404 error. – Bruno Tremblay Oct 15 '20 at 16:40
  • @BrunoTremblay Ive tested though, and my endpoint function works fine on my local machine. Perhaps I'm still missing a library somewhere. I will try to create a dummy endpoint that returns dummy data to confirm what you're saying. You seem pretty certain that this isn't a firewall issue / permissions issue? – Canovice Oct 15 '20 at 16:42
  • Do you know if it's possible to receive the error log from this somewhere – Canovice Oct 15 '20 at 16:43
  • I found the issue, but it is outside the scope of this question so I will post a new one. Thanks Bruno. – Canovice Oct 15 '20 at 17:03
  • Yeah activate debug. $setDebug(TRUE) or pr_set_debug(pr, TRUE). – Bruno Tremblay Oct 15 '20 at 18:24

0 Answers0