Add API_CARTO_URL

This commit is contained in:
gregoirenovel 2018-05-22 17:38:33 +02:00
parent 96806379e9
commit 1839269dd9
2 changed files with 6 additions and 8 deletions

View file

@ -3,13 +3,13 @@ class CARTO::SGMAP::API
end
def self.search_qp(geojson)
endpoint = "/quartiers-prioritaires/search"
call(base_url + endpoint, { geojson: geojson.to_s })
url = [API_CARTO_URL, "quartiers-prioritaires", "search"].join("/")
call(url, { geojson: geojson.to_s })
end
def self.search_cadastre(geojson)
endpoint = "/cadastre/geometrie"
call(base_url + endpoint, { geojson: geojson.to_s })
url = [API_CARTO_URL, "cadastre", "geometrie"].join("/")
call(url, { geojson: geojson.to_s })
end
private
@ -25,8 +25,4 @@ class CARTO::SGMAP::API
rescue RestClient::InternalServerError
raise RestClient::ResourceNotFound
end
def self.base_url
'https://apicarto.sgmap.fr'
end
end

View file

@ -1,3 +1,5 @@
API_CARTO_URL = "https://apicarto.sgmap.fr"
API_ENTREPRISE_URL = 'https://entreprise.api.gouv.fr/v2'
PIPEDRIVE_API_URL = 'https://api.pipedrive.com/v1'