|
@@ -109,6 +109,15 @@ func getPort() int {
|
|
|
return result
|
|
return result
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func getListenHost() string {
|
|
|
|
|
+ var defaultHost = "localhost"
|
|
|
|
|
+ host, hasHost := os.LookupEnv("HOST")
|
|
|
|
|
+ if !hasHost {
|
|
|
|
|
+ return defaultHost
|
|
|
|
|
+ }
|
|
|
|
|
+ return host
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
func getRedisUrl() string {
|
|
func getRedisUrl() string {
|
|
|
url, hasUrl := os.LookupEnv("REDIS_URL")
|
|
url, hasUrl := os.LookupEnv("REDIS_URL")
|
|
|
if !hasUrl {
|
|
if !hasUrl {
|
|
@@ -121,6 +130,7 @@ type config struct {
|
|
|
DatabaseUrl string
|
|
DatabaseUrl string
|
|
|
LogLevel logger.LogLevel
|
|
LogLevel logger.LogLevel
|
|
|
LibraryDirectory string
|
|
LibraryDirectory string
|
|
|
|
|
+ Host string
|
|
|
Port int
|
|
Port int
|
|
|
RedisUrl string
|
|
RedisUrl string
|
|
|
}
|
|
}
|