⌚ OpenOpeningstijden main server application
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

environment.rb 500B

1234567891011121314151617181920212223
  1. # frozen_string_literal: true
  2. require 'dotenv'
  3. root = Pathname.new(File.join(__dir__, '..'))
  4. Dotenv.load(root.join(".env.#{ENV['APP_ENV']}"), root.join(".env"))
  5. ##
  6. # Setup of database.
  7. Hours.configure do |config|
  8. default_app_db_url = URI::Generic.new(
  9. 'postgres',
  10. "#{ENV['DB_USER']}:#{ENV['DB_PASSWORD']}",
  11. ENV['DB_HOST'],
  12. ENV['DB_PORT'],
  13. nil,
  14. "/#{ENV['DB_NAME']}",
  15. nil,
  16. nil,
  17. nil
  18. )
  19. config.database_url = ENV['DATABASE_URL'] || default_app_db_url.to_s
  20. end