From ff0b565cc5dbbd02a4ee7f84938e98ccdf29daf4 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sun, 29 Mar 2015 20:06:48 -0700 Subject: [PATCH] make hostname configurable --- server/server.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/server.rb b/server/server.rb index aaffccb..445fe74 100755 --- a/server/server.rb +++ b/server/server.rb @@ -12,6 +12,7 @@ CONFIG_DEFAULTS = { dry_run: false, path: File.expand_path('../test-blog', __FILE__), host: '127.0.0.1', + hostname: nil, port: 6706, } @@ -54,8 +55,8 @@ def authenticated?(auth) end end -real_host = $config[:host] == '0.0.0.0' ? 'h.samhuri.net' : $config[:host] -$url_root = "http://#{real_host}:#{$config[:port]}/" +host = $config[:hostname] || $config[:host] +$url_root = "http://#{host}:#{$config[:port]}/" def url_for(*components) File.join($url_root, *components) end