Skip to content

Commit

Permalink
Set up a default SERVER_URL and made it configurable as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
futurechimp committed Jun 8, 2011
1 parent 22f4dda commit 8da152a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion config/boot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@

Padrino.load!

SERVER_URL = "http://localhost:3000"
if File.exist?("#{Padrino.root}/config/server.yml")
config = YAML.load_file("#{Padrino.root}/config/server.yml")
SERVER_URL = config["server"]["host"]
end

SERVER_URL = "http://localhost:3000" unless defined?(SERVER_URL)
puts "Server url: #{SERVER_URL}"

0 comments on commit 8da152a

Please sign in to comment.