Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.21 KB | None | 0 0
  1. 1. ActionController::RoutingError (No route matches [GET] "/cloudfoundryapplication")
  2. 2. ActionController::RoutingError (No route matches [OPTION] "/cloudfoundryapplication")
  3.  
  4. require_relative 'boot'
  5.  
  6. require "rails"
  7. # Pick the frameworks you want:
  8. require "active_model/railtie"
  9. require "active_job/railtie"
  10. require "action_controller/railtie"
  11. require "action_mailer/railtie"
  12. require "action_view/railtie"
  13. require "sprockets/railtie"
  14. require "rails/test_unit/railtie"
  15. require 'pdfkit'
  16.  
  17. # Require the gems listed in Gemfile, including any gems
  18. # you've limited to :test, :development, or :production.
  19.  
  20. Bundler.require(*Rails.groups)
  21.  
  22. module MyFaro
  23. class Application < Rails::Application
  24. # Initialize configuration defaults for originally generated Rails version.
  25. config.load_defaults 5.1
  26.  
  27. # Settings in config/environments/* take precedence over those specified here.
  28. # Application configuration should go into files in config/initializers
  29. # -- all .rb files in that directory are automatically loaded.
  30.  
  31. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
  32. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
  33. config.time_zone = 'Brussels'
  34.  
  35. # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
  36. #config.i18n.load_path = Dir[Rails.root.join('config', 'locales', '*.{rb,yml}').to_s]
  37. config.i18n.default_locale = :nl
  38.  
  39. #config.skylight.probes += %w(mongoid mongo)
  40.  
  41. config.middleware.use PDFKit::Middleware, {:print_media_type => true}, :only => %r[/print_story]
  42.  
  43. config.after_initialize do
  44. ApplicationController.helpers.cache_set_look_up_hash
  45. ApplicationController.helpers.cache_set_system_parameter_hash
  46. end
  47. end
  48. end
  49.  
  50. Rails.application.configure do
  51. # Settings specified here will take precedence over those in config/application.rb.
  52.  
  53. #CORS
  54. config.middleware.insert_before 0, Rack::Cors do
  55. allow do
  56. origins '*'
  57. resource '*', :headers => :any, :methods => [:get, :post, :options]
  58. end
  59. end
  60.  
  61. # Code is not reloaded between requests.
  62. config.cache_classes = true
  63.  
  64. # Eager load code on boot. This eager loads most of Rails and
  65. # your application in memory, allowing both threaded web servers
  66. # and those relying on copy on write to perform better.
  67. # Rake tasks automatically ignore this option for performance.
  68. config.eager_load = true
  69.  
  70. # Full error reports are disabled and caching is turned on.
  71. config.consider_all_requests_local = false
  72. config.action_controller.perform_caching = true
  73. config.cache_store = :memory_store
  74.  
  75. # Attempt to read encrypted secrets from `config/secrets.yml.enc`.
  76. # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or
  77. # `config/secrets.yml.key`.
  78. config.read_encrypted_secrets = true
  79.  
  80. # Disable serving static files from the `/public` folder by default since
  81. # Apache or NGINX already handles this.
  82. config.public_file_server.enabled = true
  83.  
  84. # Compress JavaScripts and CSS.
  85. config.assets.js_compressor = :uglifier
  86. # config.assets.css_compressor = :sass
  87.  
  88. # Do not fallback to assets pipeline if a precompiled asset is missed.
  89. config.assets.compile = true
  90.  
  91. # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
  92.  
  93. # Enable serving of images, stylesheets, and JavaScripts from an asset server.
  94. # config.action_controller.asset_host = 'http://assets.example.com'
  95.  
  96. # Specifies the header that your server uses for sending files.
  97. # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
  98. # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
  99.  
  100. # Mount Action Cable outside main process or domain
  101. # config.action_cable.mount_path = nil
  102. # config.action_cable.url = 'wss://example.com/cable'
  103. # config.action_cable.allowed_request_origins = [ 'http://example.com', /http://example.*/ ]
  104.  
  105. # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
  106. config.force_ssl = true
  107.  
  108. # Use the lowest log level to ensure availability of diagnostic information
  109. # when problems arise.
  110. config.log_level = :error
  111.  
  112. # Prepend all log lines with the following tags.
  113. config.log_tags = [ :request_id ]
  114.  
  115. # Use a different cache store in production.
  116. # config.cache_store = :mem_cache_store
  117.  
  118. # Use a real queuing backend for Active Job (and separate queues per environment)
  119. # config.active_job.queue_adapter = :resque
  120. # config.active_job.queue_name_prefix = "my_faro_#{Rails.env}"
  121. config.action_mailer.perform_caching = false
  122.  
  123. # Ignore bad email addresses and do not raise email delivery errors.
  124. # Set this to true and configure the email server for immediate delivery to raise delivery errors.
  125. config.action_mailer.raise_delivery_errors = true
  126. config.action_mailer.perform_deliveries = true
  127. config.action_mailer.default_url_options = { host: 'http://myfaro.cfapps.io/'}
  128. config.action_mailer.delivery_method = :smtp
  129. config.action_mailer.smtp_settings = {
  130. address: 'smtp.mailgun.org',
  131. port: 587,
  132. authentication: 'plain',
  133. #domain: 'sandboxe3e6f1cfc3d34efc8dba23c1a1eaff8b.mailgun.org',
  134. domain: 'mg.myfaro.be',
  135. #user_name: 'postmaster@sandboxe3e6f1cfc3d34efc8dba23c1a1eaff8b.mailgun.org',
  136. user_name: 'postmaster@mg.myfaro.be',
  137. #password: '25c695256391ca3e9f6c6bb1dd9f622f'
  138. password: 'f1d6d58994362f084cc2ecac0e46256c'
  139. }
  140. # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  141. # the I18n.default_locale when a translation cannot be found).
  142. config.i18n.fallbacks = true
  143. config.i18n.available_locales = [:en,:nl,:fr,:de]
  144.  
  145. # Send deprecation notices to registered listeners.
  146. config.active_support.deprecation = :notify
  147.  
  148. # Use default logging formatter so that PID and timestamp are not suppressed.
  149. config.log_formatter = ::Logger::Formatter.new
  150.  
  151. # Use a different logger for distributed setups.
  152. # require 'syslog/logger'
  153. # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
  154.  
  155. if ENV["RAILS_LOG_TO_STDOUT"].present?
  156. logger = ActiveSupport::Logger.new(STDOUT)
  157. logger.formatter = config.log_formatter
  158. config.logger = ActiveSupport::TaggedLogging.new(logger)
  159. end
  160.  
  161. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement