Linux Server上的R Plumber [英] R plumber on Linux Server
本文介绍了Linux Server上的R Plumber的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用水管工代码制作了一个.R文件.该文件在我的本地PC上运行良好,在我的linux服务器上也运行良好. 现在我唯一的问题是,它仅是本地的.
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.
我需要能够通过服务器地址获取API. 服务器还运行一个cronR进程,该进程进行所有数学运算和一个闪亮的应用程序以显示一些图形.所有的数学运算都存储在cvs文件中,水管工现在应该获取最后的索引并显示该索引,以便我可以在任何地方使用它.
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.
有什么解决办法吗?
代码:
library(plumber)
path = "/srv/shiny-server/Crypto10/data/"
r = plumb(paste(path,"API.R", sep = ""))
r$run(port=8000)
推荐答案
尝试
r$run(host="0.0.0.0",port=8000)
这篇关于Linux Server上的R Plumber的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文