"An exception occurred" when hitting RPlumber API from Ubuntu 16.04

236 views Asked by At

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!

0

There are 0 answers