cartodb-4.42/app/helpers/sql_api_helper.rb

15 lines
467 B
Ruby
Raw Normal View History

2024-04-06 13:25:13 +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.get_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