Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I like this version of the nodejs starter code better: <a href="https://github.com/ryanj/nodejs-custom-version-openshift">https://github.com/ryanj/nodejs-custom-version-openshift</a></p> <p>It contains a newer version of the <code>.openshift</code> application build hooks for nodejs. It will read the Marker file, but also has support for reading directly from your <code>package.json</code> file's <code>engines</code> attribute to compile your Nodejs runtime.</p> <pre><code>"engines": { "node": "&gt;= 0.10.0", "npm": "&gt;= 1.0.0" }, </code></pre> <p>I'm hoping to <a href="https://github.com/openshift/nodejs-custom-version-openshift/pull/3">get this merged in</a> as the default <code>.openshift</code> folder content for all nodejs apps on OpenShift.</p> <p>You'll also want to make sure that you are binding to the <strong><em>NEW</em></strong> environment variables: <code>OPENSHIFT_NODEJS_IP</code> and <code>OPENSHIFT_NODEJS_PORT</code>. These were recently renamed.</p> <p>I usually add something like this to my application code, allowing it to run anywhere:</p> <pre><code>var ip_addr = process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1'; var port = process.env.OPENSHIFT_NODEJS_PORT || '8080'; </code></pre> <p>OpenShift currently shows you the output from <code>npm start</code>, which may not reveal all of your application's output. For additional debugging info, you could try starting your app manually:</p> <ol> <li>First, stop your app from the command line: <code>rhc app stop APP_NAME</code></li> <li>Then, connect to your application gear / container <code>rhc ssh APP_NAME</code></li> <li><code>cd $OPENSHIFT_REPO_DIR</code></li> <li>and manually run whatever command is defined within your <code>package.json</code> file's <code>scripts.start</code> attribute.</li> </ol> <p>Hopefully that gives you a bit more visibility into what is going on.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload