Make API_ADRRESSE_URL canonical

This commit is contained in:
gregoirenovel 2018-10-15 16:38:17 +02:00
parent 9156acb839
commit 442b4a241b
2 changed files with 4 additions and 2 deletions

View file

@ -8,7 +8,9 @@ module ApiAdresse
end
def call
RestClient.get(API_ADRESSE_URL, params: { q: @address, limit: @limit })
search_url = [API_ADRESSE_URL, "search"].join("/")
RestClient.get(search_url, params: { q: @address, limit: @limit })
rescue RestClient::ServiceUnavailable
nil
end

View file

@ -1,5 +1,5 @@
# API URLs
API_ADRESSE_URL = "https://api-adresse.data.gouv.fr/search"
API_ADRESSE_URL = "https://api-adresse.data.gouv.fr"
API_CARTO_URL = "https://apicarto.sgmap.fr"
API_ENTREPRISE_URL = "https://entreprise.api.gouv.fr/v2"
API_GEO_URL = "https://geo.api.gouv.fr"