Use a constant for the API Entreprise URL

This commit is contained in:
gregoirenovel 2018-08-27 16:12:34 +02:00
parent 625f3696f1
commit 9284afc649
3 changed files with 3 additions and 7 deletions

View file

@ -45,7 +45,7 @@ class ApiEntreprise::API
end
def self.url(resource_name, siret_or_siren)
[base_url, resource_name, siret_or_siren].join("/")
[API_ENTREPRISE_URL, resource_name, siret_or_siren].join("/")
end
def self.params(siret_or_siren, procedure_id)
@ -62,8 +62,4 @@ class ApiEntreprise::API
def self.token
Rails.application.secrets.api_entreprise[:key]
end
def self.base_url
Rails.application.secrets.api_entreprise[:base_url]
end
end

View file

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

View file

@ -31,7 +31,6 @@ defaults: &defaults
secret_key: <%= ENV['MAILJET_SECRET_KEY'] %>
api_entreprise:
key: <%= ENV['API_ENTREPRISE_KEY'] %>
base_url: <%= ENV['API_ENTREPRISE_BASE_URL'] %>
pipedrive:
key: <%= ENV['PIPEDRIVE_KEY'] %>
fog:
@ -57,7 +56,6 @@ test:
signing_key: aef3153a9829fa4ba10acb02927ac855df6b92795b1ad265d654443c4b14a017
api_entreprise:
key: api_entreprise_test_key
base_url: https://entreprise.api.gouv.fr/v2
fog:
base_url: https://storage.apientreprise.fr
directory: tps_dev