Class: SccGrape::API

Inherits:
Grape::API
  • Object
show all
Defined in:
lib/scc_grape/api.rb

Class Method Summary collapse

Class Method Details

.reload_configObject



20
21
22
23
24
25
26
27
28
# File 'lib/scc_grape/api.rb', line 20

def self.reload_config
  if ENV['CONFIG_SERVER_URL'].blank?
    puts 'No CONFIG_SERVER_URL provided, scc_rails will not fetch config from spring cloud config server'
  elsif ENV['APP_NAME'].blank?
    puts 'No APP_NAME provided, scc_rails will not fetch config from spring cloud config server'
  else
    $cloud_env = SccRuby::Api.fetch(ENV['CONFIG_SERVER_URL'], ENV['APP_NAME'], ENV['APP_ENV'] || 'default', ENV['CLOUD_USERNAME'] || '', ENV['CLOUD_PASSWORD'] || '')
  end
end