Permalink
Browse files

externalPort option

  • Loading branch information...
1 parent 2e6a825 commit 72b1c4a1642fbbea20886ba61226b7809bf6debc @nickmerwin committed Oct 1, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/auto-uri.js
View
@@ -18,7 +18,8 @@ function AutoUri(hostname, opts) {
opts = opts || {};
self.hostname = hostname;
- self.port = opts.port || 31337;
+ self.port = opts.port || process.env.PORT || 31337;
+ self.externalPort = opts.externalPort;
self.basePath = opts.basePath || 'autoprovision';
self.provisionedPaths = {
'GET': {},
@@ -32,7 +33,7 @@ function AutoUri(hostname, opts) {
);
self.express.listen(self.port);
- self.baseUri = 'http://' + self.hostname + ':' + self.port + '/' + self.basePath + '/';
+ self.baseUri = 'http://' + self.hostname + ( self.externalPort ? ':' + self.externalPort : '') + '/' + self.basePath + '/';
self.expressPath = '/' + self.basePath + '/:index';
self.index = 0;

0 comments on commit 72b1c4a

Please sign in to comment.