diff options
Diffstat (limited to 'go/index.js')
-rw-r--r-- | go/index.js | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/go/index.js b/go/index.js index 16b6df98..44ff79b5 100644 --- a/go/index.js +++ b/go/index.js @@ -1,15 +1,21 @@ -// configuration (and defaults) +// configuration var hostname = process.env.HOSTN; -var httpPort = process.env.PORT || 1337; +var httpPort = process.env.PORT; +var uriPrefix = process.env.URI_PREFIX; var redisPrefix = 'go:'; // automatic configuration -var uriPrefix = ''; -if (hostname) { - uriPrefix += 'http://' + hostname; - if (httpPort != 80) { - uriPrefix += ':' + httpPort; +if (!httpPort) { + httpPort = 1337; +} +if (!uriPrefix) { + uriPrefix = ''; + if (hostname) { + uriPrefix += 'http://' + hostname; + if (httpPort != 80) { + uriPrefix += ':' + httpPort; + } } } |