Sha256: b0db48e818deaee9858d43e0907780ad0ef259e9e81bacf8bb2086c0209f2b54

Contents?: true

Size: 1.84 KB

Versions: 21

Compression:

Stored size: 1.84 KB

Contents

# frozen_string_literal: true

module NeetoCommonsBackend
  module Environments
    class << self
      def production(config)
        config.cache_classes = true
        config.eager_load = true
        config.consider_all_requests_local = false
        config.action_mailer.delivery_method = :smtp
        config.action_mailer.perform_deliveries = true
        config.action_controller.perform_caching = true
        config.assets.js_compressor = Uglifier.new(harmony: true)
        config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
        config.assets.compile = false
        if Rails.application.secrets.asset_host.present?
          config.action_controller.asset_host = Rails.application.secrets.asset_host
        end

        config.active_storage.service = ENV["AWS_BUCKET_NAME"].present? ? :amazon : :local
        config.force_ssl = true
        config.log_level = Rails.application.secrets.log_level
        config.log_tags = [:request_id]
        config.action_mailer.perform_caching = false
        config.i18n.fallbacks = true
        config.active_support.report_deprecations = false
        config.log_formatter = ::Logger::Formatter.new
        config.active_record.dump_schema_after_migration = false
        config.action_controller.forgery_protection_origin_check = false

        config.action_cable.disable_request_forgery_protection = true
        if Rails.application.secrets.web_socket_server_url.present?
          config.web_socket_server_url = Rails.application.secrets.web_socket_server_url
          config.action_cable.url = Rails.application.secrets.web_socket_server_url
        end

        config.public_file_server.enabled = true
        config.public_file_server.headers = {
          "Access-Control-Allow-Origin" => "*",
          "Cache-Control" => "public, max-age=31536000"
        }
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
neeto-commons-backend-1.0.109 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.108 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.107 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.106 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.105 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.104 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.103 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.102 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.101 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.100 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.99 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.98 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.97 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.96 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.95 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.94 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.93 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.92 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.91 lib/neeto_commons_backend/environments/production.rb
neeto-commons-backend-1.0.90 lib/neeto_commons_backend/environments/production.rb