Sha256: 6d3ab8fe9492f2792db46ed98e2ffcd96b397b1396fc0ea8069ccfcb4627cc18

Contents?: true

Size: 662 Bytes

Versions: 2

Compression:

Stored size: 662 Bytes

Contents

require "plek"

module GovukAppConfig
  class Railtie < Rails::Railtie
    initializer "govuk_app_config.configure_govuk_proxy" do |app|
      if ENV["GOVUK_PROXY_STATIC_ENABLED"] == "true"
        app.middleware.use GovukProxy::StaticProxy, backend: Plek.find("static")
      end
    end

    initializer "govuk_app_config.configure_open_telemetry" do |app|
      GovukOpenTelemetry.configure(app.class.module_parent_name.underscore)
    end

    config.before_initialize do
      GovukJsonLogging.configure if ENV["GOVUK_RAILS_JSON_LOGGING"]
    end

    config.after_initialize do
      GovukError.configure unless GovukError.is_configured?
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
govuk_app_config-9.0.1 lib/govuk_app_config/railtie.rb
govuk_app_config-9.0.0 lib/govuk_app_config/railtie.rb