title: Say 'Hello World!' in Openshift with Node.js
body: <p>I created an app in Openshift and created a local git repo on my computer. I want to change the default welcome page here: <a href="http://nodejs-j4nos.rhcloud.com:3000" rel="nofollow noreferrer">http://nodejs-j4nos.rhcloud.com:3000</a> and just tell Hello world as <a href="http://expressjs.com/starter/hello-world.html" rel="nofollow noreferrer">this</a> tutorial say.</p>
  
  <p>So I removed from local repo the index.html, and modified server.js, pasted in this code below. And commit, and push. I get a long approval, that they accepted my commit. </p>
  
  <p>If I good understand I do not have to stop node and start it again, but Openshift do it for me. But as you can see no Hello World is able to see, when open link in browser (<a href="http://nodejs-j4nos.rhcloud.com:3000" rel="nofollow noreferrer">http://nodejs-j4nos.rhcloud.com:3000</a>) why?</p>
  
  <pre><code>var express = require('express');
  var app = express();
  
  app.get('/', function (req, res) {
    res.send('Hello World!');
  });
  
  var server = app.listen(3000, function () {
  
    var host = server.address().address;
    var port = server.address().port;
  
    console.log('Example app listening at http://%s:%s', host, port);
  
  });
  </code></pre>
  
  <hr>
  
  <pre><code>remote: Git Post-Receive Result: success        
  remote: Activation status: success        
  remote: Deployment completed with status: success        
  To ssh://5556b4c4fcf9336abf0000de@nodejs-j4nos.rhcloud.com/~/git/nodejs.git/
  </code></pre>
  
  <p>and here is the tree structure, <code>express</code> is listed</p>
  
  <p><img src="https://i.stack.imgur.com/Ub7n0.png" alt="enter image description here"></p>
  
  <p>Based on <a href="https://stackoverflow.com/questions/22582725/deployed-node-app-to-openshift-successfully-openshift-still-shows-default-page?rq=1">this</a> SO answer I tried to modify script, but does not helped:</p>
  
  <pre><code>var express = require('express');
  var app = express();
  
  app.set('port', process.env.OPENSHIFT_NODEJS_PORT || 8080);
  app.set('ip', process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1');
  
  http.createServer(app).listen(app.get('port'), app.get('ip'), function(){
    console.log('Express server listening on port ' + app.get('port'));
  });
  
  app.get('/', function (req, res) {
    res.send('Hello World!');
  });
  </code></pre>