Permalink
Browse files

Support c9.io HOST and IP env vars

  • Loading branch information...
1 parent d2c9378 commit b004d3352fffb6ef5efe8cad75c471e8afbc16ca @arikon arikon committed Sep 30, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/commands/server.js
@@ -4,7 +4,8 @@ var SERVER = require('../server').Server,
LOGGER = require('../logger'),
DEFAULT_WORKERS = require('../make').DEFAULT_WORKERS,
- DEFAULT_PORT = 8080,
+ DEFAULT_HOST = process.env.IP,
+ DEFAULT_PORT = process.env.PORT || 8080,
DEFAULT_SOCKET = '.bem/server.sock',
DEFAULT_SOCKET_MODE = '0644';
@@ -31,7 +32,8 @@ module.exports = function() {
.end()
.opt()
.name('host').long('host')
- .title('hostname to listen on, default: any')
+ .title('hostname to listen on, default: ' + (DEFAULT_HOST || 'any'))
+ .def(DEFAULT_HOST)
.end()
.opt()
.name('port').short('p').long('port')

0 comments on commit b004d33

Please sign in to comment.