Sha256: dd631555c84b62d8a92f5af447d4f8469ad47988b1ef4077d5c7a399bf8fa961

Contents?: true

Size: 1.1 KB

Versions: 8

Compression:

Stored size: 1.1 KB

Contents

require 'bundler/setup'
require 'hanami/setup'
require 'hanami/model'
require_relative '../lib/<%= project %>'

Hanami.configure do

  model do
    ##
    # Database adapter
    #
    # Available options:
    #
    #  * SQL adapter
    #    adapter :sql, 'sqlite://db/<%= project %>_development.sqlite3'
    #    adapter :sql, 'postgresql://localhost/<%= project %>_development'
    #    adapter :sql, 'mysql://localhost/<%= project %>_development'
    #
    adapter :<%= database_config_hash[:type] %>, ENV.fetch('DATABASE_URL')

    <%- if database_config.sql? -%>
    ##
    # Migrations
    #
    migrations 'db/migrations'
    schema     'db/schema.sql'
    <%- end -%>
  end

  mailer do
    root 'lib/<%= project %>/mailers'

    # See http://hanamirb.org/guides/mailers/delivery
    delivery :test
  end

  environment :development do
    # See: http://hanamirb.org/guides/projects/logging
    logger level: :debug
  end

  environment :production do
    logger level: :info, formatter: :json, filter: []

    mailer do
      delivery :smtp, address: ENV.fetch('SMTP_HOST'), port: ENV.fetch('SMTP_PORT')
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hanami-1.3.1 lib/hanami/cli/commands/new/config/environment.erb
hanami-1.3.0 lib/hanami/cli/commands/new/config/environment.erb
hanami-1.3.0.beta1 lib/hanami/cli/commands/new/config/environment.erb
hanami-1.2.0 lib/hanami/cli/commands/new/config/environment.erb
hanami-1.2.0.rc2 lib/hanami/cli/commands/new/config/environment.erb
hanami-1.2.0.rc1 lib/hanami/cli/commands/new/config/environment.erb
hanami-1.2.0.beta2 lib/hanami/cli/commands/new/config/environment.erb
hanami-1.2.0.beta1 lib/hanami/cli/commands/new/config/environment.erb