environment.rb 689 B

12345678910111213141516171819202122232425262728
  1. require 'bundler/setup'
  2. require 'hanami/setup'
  3. require 'hanami/model'
  4. require_relative '../lib/hello_world'
  5. require_relative '../apps/web/application'
  6. Hanami.configure do
  7. mount Web::Application, at: '/'
  8. model do
  9. ##
  10. # Database adapter
  11. #
  12. # Available options:
  13. #
  14. # * SQL adapter
  15. # adapter :sql, 'sqlite://db/hello_world_development.sqlite3'
  16. # adapter :sql, 'postgresql://localhost/hello_world_development'
  17. # adapter :sql, 'mysql://localhost/hello_world_development'
  18. #
  19. host = ENV['DB_HOST'] || 'localhost'
  20. adapter :sql, "mysql2://benchmarkdbuser:benchmarkdbpass@#{host}/hello_world"
  21. end
  22. environment :production do
  23. end
  24. end