Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Data Science APIs on Cloud Foundry with R Plumber

License

Notifications You must be signed in to change notification settings

vmware-archive/cf-r-plumber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plumber API Example, slightly modified to run on Cloud Foundry (CF).

Note the following important nuances:

  • The host should be set as "0.0.0.0" in the pr$run function in startscript.R
  • The port is best set by including PORT <- as.numeric( Sys.getenv('PORT') ) and then supplying PORT as the argument in the pr$run function in startscript.R

To push this app to your CF environment, run the following command after establishing an API endpoint:

cf push rplumber -b https://github.com/cloudfoundry/r-buildpack.git

An example API is hosted live on a Cloud Foundry environment here. To test the API is working try typing the following into a web browser:

https://rplumber.apps.pcfone.io/echo?msg=DataScienceonPCF!

Also try typing the following simple summing function in a terminal window (return sum of 5 and 6):

curl --data "a=5&b=6" "https://rplumber.apps.pcfone.io/sum"

About

Data Science APIs on Cloud Foundry with R Plumber

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published