Sunday 3 June 2012

Problems deploying a node js app to cloudfoundry

 I have a small Node.js app that exposes an JSON service which I wan to use in my main app. However, I ran into a hitch with deploying to CloudFoundry. When I do a deploy, this is what I get:




 Error: EACCES, Permission denied  



Turns out the culprit was this in my init method:



 var port = 8081;



I actually needed to do this instead:



 var port = process.env.VCAP_APP_PORT || 8081;



Hope that helps somebody!



1 comment:

  1. Thanks, I had same issue and your suggestion fixed it

    ReplyDelete