Permalink
Browse files

Fix the port and audience variables to also work on petri.

  • Loading branch information...
1 parent e0986b0 commit caa7ae41ae9e491eff98af77ad8acf1033eef916 @fqueze fqueze committed Nov 30, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 app.js
View
10 app.js
@@ -17,8 +17,14 @@ app.use(express.session());
app.use(express.static(__dirname + "/static"));
var users = {};
-var port = process.env.PORT || 5000;
-var audience = process.env.AUDIENCE || "http://webrtc-social.herokuapp.com";
+var port = process.env.VMC_APP_PORT || process.env.PORT || 5000;
+var audience;
+if (process.env.AUDIENCE)
+ audience = process.env.AUDIENCE;
+else if (process.env.VMC_APP_NAME)
+ audience = "https://" + process.env.VMC_APP_NAME + ".vcap.mozillalabs.com";
+else
+ audience = "http://webrtc-social.herokuapp.com";
// We use EventSource for presence. The events are named "userjoined"
// and "userleft".

0 comments on commit caa7ae4

Please sign in to comment.