cartodb/app/helpers/sql_api_helper.rb

15 lines
463 B
Ruby
Raw Permalink Normal View History

2020-06-15 10:58:47 +08:00
module SqlApiHelper
def sql_api_template(privacy="private")
sql_api_url('{user}', privacy)
end
def sql_api_url(username, privacy = 'private')
sql_api = Cartodb.config[:sql_api][privacy]
if CartoDB.subdomainless_urls?
sql_api["protocol"] + "://" + sql_api["domain"] + ":" + sql_api["port"].to_s + "/user/#{username}"
else
sql_api["protocol"] + "://#{username}." + sql_api["domain"] + ":" + sql_api["port"].to_s
end
end
end