title: Openshift always gives 503 error for Node.js app
body: <p>I'm trying to setup my very first Node.js + express web app using Openshift's free service.</p>
  
  <p>I installed node + npm and the openshift tools on my computer, and tried to run my app. On my local machine everything works fine, but after I push my project to Openshift site, it always gives the <code>'503 Service Unavailable'</code> error.</p>
  
  <p>I tried to <code>rhc app restart -a firstapp</code> ,but it didn't solve the problem. I also checked the package.json and it is correct.</p>
  
  <p>Here's my code: </p>
  
  <pre><code>var express = require('express');
  var app = express();
  var fs      = require('fs');
  var parser  = require('body-parser');
  
  //Setup ip adress and port
  var ipaddress ;
  
  function initIPAdress() {
      var adr = process.env.OPENSHIFT_NODEJS_IP;
      if (typeof adr === "undefined") {
              //  Log errors on OpenShift but continue w/ 127.0.0.1 - this
              //  allows us to run/test the app locally.
              console.warn('No OPENSHIFT_NODEJS_IP var, using localhost');
              adr = 'localhost';
      }
  
      ipaddress = adr;
  }
  
  var port      = process.env.OPENSHIFT_NODEJS_PORT || 8080;
  
  
  app.get('/', function (req, res) {
    res.send('Hello World!')
  })
  
  app.get('/admin', function (req, res) {
          res.setHeader('Content-Type', 'text/html'); 
          res.send( fs.readFileSync('./index_admin.html') );
  })
  
  app.listen(port, ipaddress, function() {
          initIPAdress();//Call setup ip adress
          console.log('%s: Node server started on %s:%d ...',
                          Date(Date.now() ), ipaddress, port);
  });
  </code></pre>