Module: ApplicationConfiguration
- Included in:
- Application, ConsulConfiguration, RestConfiguration
- Defined in:
- lib/application_configuration.rb
Instance Method Summary collapse
Instance Method Details
#config ⇒ Object
4 5 6 7 8 9 |
# File 'lib/application_configuration.rb', line 4 def config { rest: config_rest, consul: config_consul } end |
#config_consul ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/application_configuration.rb', line 11 def config_consul config_consul = { port: 8500, path: "http://localhost", consul_service_data: { name: "Service-1", id: "Service1", port: 9292, check: { id: "bluesky-api", name: "HTTP Health Check API on port 9292", http: "http://localhost:9292/health-check-new", tls_skip_verify: false, method: "GET", interval: "10s", timeout: "1s" } } } config_consul[:consul_service_data][:port] = config_rest[:port] config_consul[:consul_service_data][:check][:http] = "http://#{config_rest[:host]}:#{config_rest[:port].to_s}/#{random_name}" config_consul end |
#config_rest ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/application_configuration.rb', line 35 def config_rest config_rest = { host: 'localhost', port: 9292, path: '/api/v1' } end |
#random_name ⇒ Object
43 44 45 |
# File 'lib/application_configuration.rb', line 43 def random_name "health-check-#{SecureRandom.urlsafe_base64(8)}" end |