R plumber on Linux Server

人盡茶涼 提交于 2019-12-23 01:18:15

问题


I've made a .R file with a plumber code. The file works fine on my local pc, it works also fine on my linux server. My only problem now is, that it's only local.

I need to be able to get the API over the server adress. The server also runs a cronR process which makes all the math and a shiny-app to display some graphs. All the math is stored into an cvs file and plumber should now get the last index and display this so I can use it from everywhere.

Are there any solutions?

Code:

library(plumber)

path = "/srv/shiny-server/Crypto10/data/"

r = plumb(paste(path,"API.R", sep = ""))  

r$run(port=8000)

回答1:


try

r$run(host="0.0.0.0",port=8000)


来源:https://stackoverflow.com/questions/47218743/r-plumber-on-linux-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!