Skip to content

Commit

Permalink
externalPort option
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmerwin committed Oct 1, 2011
1 parent 2e6a825 commit 72b1c4a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/auto-uri.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function AutoUri(hostname, opts) {


opts = opts || {}; opts = opts || {};
self.hostname = hostname; 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.basePath = opts.basePath || 'autoprovision';
self.provisionedPaths = { self.provisionedPaths = {
'GET': {}, 'GET': {},
Expand All @@ -32,7 +33,7 @@ function AutoUri(hostname, opts) {
); );
self.express.listen(self.port); 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.expressPath = '/' + self.basePath + '/:index';
self.index = 0; self.index = 0;


Expand Down

0 comments on commit 72b1c4a

Please sign in to comment.