title: Openshift node.js successful deployment, but "Application is not available"
body: <p>I'm having a problem getting a node.js app to run on Openshift.</p>
  
  <p>I've set up my openshift project to pull from a git repo.</p>
  
  <p>My <code>server.listen</code> call is being made like this:</p>
  
  <pre><code>var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.PORT || 8080;
  var ip = process.env.OPENSHIFT_NODEJS_IP || process.env.IP || '127.0.0.1';
  
  var server = http.createServer(myServerFunction);
  server.listen(port, ip);
  </code></pre>
  
  <p>The pull and build work fine. I can see in the pod terminal that my app is running because there is some <code>console.log</code> output indicating this. I can also see that neither <code>process.env.OPENSHIFT_NODEJS_IP</code> nor <code>process.env.IP</code> exist, and so the port has defaulted to <code>8080</code>.</p>
  
  <p>If I go into the pod's terminal and execute <code>curl http://localhost:8080</code> I see precisely the html output I would expect from my app.</p>
  
  <p>However, when I click on the overview tab and find the external url for my app (which is of the format <code>http://&lt;application&gt;-&lt;domain&gt;.1d35.starter-us-east-1.openshiftapps.com</code>), clicking that link results in openshift's "Application is not available" error page.</p>
  
  <p>It seems to me that my node app is running perfectly well, but is not connected to the external url. I suspect that <code>8080</code> is not the correct port, and that I am required to do more configuration in order for my nodejs app to receive a value at <code>process.env.OPENSHIFT_NODEJS_PORT</code>.</p>
  
  <p>In other stackoverflow answers I've also seen <code>0.0.0.0</code> as the default when <code>process.env.OPENSHIFT_NODEJS_IP</code> is not set. Could this make a difference?</p>
  
  <p><strong>Overall, how can I make the external url link to my nodejs server?</strong></p>
  
  <p>Thanks for any help!</p>