1. Sean Wilkinson
  2. qmachine

Commits

Sean Wilkinson  committed 927708e

Added some OpenShift environment detections to web-service demo

  • Participants
  • Parent commits 8032855
  • Branches master

Comments (0)

Files changed (1)

File src/web-service/server.js

View file
 
 //- server.js ~~
 //                                                      ~~ (c) SRW, 06 Oct 2012
-//                                                  ~~ last updated 15 Dec 2013
+//                                                  ~~ last updated 16 Dec 2013
 
 (function () {
     'use strict';
         options.hostname = process.env.IP;
     }
 
+    if (process.env.OPENSHIFT_INTERNAL_IP !== undefined) {
+     // This is for use with OpenShift.
+        options.hostname = process.env.OPENSHIFT_INTERNAL_IP;
+    }
+
+    if (process.env.OPENSHIFT_INTERNAL_PORT !== undefined) {
+     // This is for use with OpenShift.
+        options.port = process.env.OPENSHIFT_INTERNAL_PORT;
+    }
+
     if (process.env.PORT !== undefined) {
      // This is for use with Heroku.
         options.port = process.env.PORT;