Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sinatra base url helper
def base_url
@base_url ||= "#{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment