Unable to push Sample Shiny App to Bluemix

2019-08-09 05:19发布

问题:

Unable to push Sample App to Bluemix

Hi ,

I was attempting to try out the sample tutorial for Shiny with Bluemix -http://www.ibm.com/developerworks/library/ba-rtwitter-app/index.html

After going through multiple questions, I figured the app is not listening to the port assigned dynamically by Bluemix -ERROR : "Failed to accept connection within health check timeout..."

Since the app requires cf-buildpack-r would it be fair to assume the environment variables are also handled by the same package ?

Where do I add the following snippet ?

var port=process.env.VCAP_APP_PORT || 1337; http.createServer(app).listen(port), function(){ console.log('Express server listening on port ' + port); });

As there is no other visible js code present. I am not sure if I am missing something.

How to make the necessary modifications as there is no reproducible example for debugging this type of error ?

Command

cf push EdusasApp -b https://github.com/aruizga7/cf-buildpack-r --no-route

I also created a local manifest.yml containing :

applications: - host: Edusas disk: 1024M name: Edusas buildpack: https:..../cf-buildpack-r path: . domain: ng.bluemix.net mem: 512M instances:

Kindly Help

回答1:

Check out the project that was referenced in the docs, http://hub.jazz.net/project/crackmanworld/TwitterBluemix/overview. In the project there is a file, http://hub.jazz.net/project/crackmanworld/TwitterBluemix/… that contains the server startup. When the server starts up it binds to a port defined in an environment variable VCAP_APP_PORT, you can also use VCAP_PORT if you want as well.