Skip to content

Commit

Permalink
using a command line argument of 'cloud9' will have the server listen…
Browse files Browse the repository at this point in the history
… on the proper port and host for the online cloud9 ide, otherwise the server listens on port 80 and localhost. Production mode now minimizes and packs assets
  • Loading branch information
tylorr committed Jan 27, 2012
1 parent 9170f75 commit f889f36
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app.js
Expand Up @@ -19,14 +19,16 @@ ss.client.formatters.add(require('ss-jade'));
ss.client.formatters.add(require('ss-stylus'));

// Minimise and pack assets if you type SS_ENV=production node app
//if (ss.env == 'production') ss.client.packAssets();
if (ss.env == 'production') ss.client.packAssets();

var server = http.Server(ss.http.middleware);

if (ss.env == 'production') {
server.listen(80);
} else {
var arguments = process.argv.splice(2);

if (arguments[0] == 'cloud9') {
server.listen(process.env.C9_PORT, "0.0.0.0");
} else {
server.listen(80);
}

ss.start(server);

0 comments on commit f889f36

Please sign in to comment.