This commit is contained in:
Harman Singh 2017-05-30 08:03:51 +00:00 committed by GitHub
commit 9b8c352a23
1 changed files with 8 additions and 2 deletions

10
app.rb
View File

@ -5,7 +5,13 @@ require 'yaml'
def get_url(domain_object, rel_route)
if domain_object.is_a? Hash
return domain_object['root'] + "/" + rel_route
if domain_object.key? 'root'
domain_object['root'] + '/' + rel_route
elsif domain_object.key? rel_route
domain_object[rel_route]
else
domain_object.values.first
end
elsif domain_object.is_a? String
return domain_object
end
@ -27,4 +33,4 @@ get '/*' do
end
halt 404, "#{hostname} hasn't been setup yet."
end
end