From 7023ea2453bde5a09ffd2555c4237443ad88b643 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 6 Jan 2014 01:38:37 +0100 Subject: go: make URI_PREFIX configurable --- go/index.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'go/index.js') 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; + } } } -- cgit v1.2.3