Permalink
Browse files

added environment configuration

  • Loading branch information...
1 parent d15ca78 commit ea9fe5f8d8c45891134e9e2b43161b41e5713b6e Eiji Kitamura committed Feb 29, 2012
Showing with 10 additions and 3 deletions.
  1. +4 −1 routes/index.js
  2. +5 −1 server.js
  3. +1 −1 views/layout.ejs
View
@@ -3,5 +3,8 @@
*/
exports.index = function(req, res){
- res.render('index', { title: 'Express' });
+ res.render('index', {
+ title: 'Express',
+ WS_HOST: WS_HOST
+ });
};
View
@@ -20,10 +20,14 @@ app.configure(function(){
});
app.configure('development', function(){
+ var WS_HOST = 'ws://localhost:3000';
+ var HOST_PORT = '3000';
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
app.configure('production', function(){
+ var WS_HOST = 'ws://agektmr.node-ninja.com';
+ var HOST_PORT = '80';
app.use(express.errorHandler());
});
@@ -34,7 +38,7 @@ app.get('/', routes.index);
var listeners = [],
players = [];
-app.listen(3000, function() {
+app.listen(HOST_PORT, function() {
var wsp = new WebSocketServer({server:app, path:'/play'});
var wsl = new WebSocketServer({server:app, path:'/listen'});
wsp.on('connection', function(ws) {
View
@@ -7,7 +7,7 @@
<script src="js/AudioStreamer.js"></script>
<script src="js/SpectrumVisualizer.js"></script>
<script>
- var WS_HOST = 'ws://localhost:3000',
+ var WS_HOST = '<% = WS_HOST %>',
as = null;
playEnd = function() {
if (as.audioReady) {

0 comments on commit ea9fe5f

Please sign in to comment.