Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

externalPort option

  • Loading branch information...
commit 72b1c4a1642fbbea20886ba61226b7809bf6debc 1 parent 2e6a825
@nickmerwin authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/auto-uri.js
View
5 lib/auto-uri.js
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.