Sha256: eeb6336d547a94ee2313aaac3f5927f30ad812041ad41a9051876fecfa23e72f

Contents?: true

Size: 774 Bytes

Versions: 4

Compression:

Stored size: 774 Bytes

Contents

require "dry/web/roda/application"
require_relative "container"

module <%= config[:camel_cased_app_name] %>
  class Application < Dry::Web::Roda::Application
    configure do |config|
      config.container = Container
      config.routes = "web/routes".freeze
    end

    opts[:root] = Pathname(__FILE__).join("../..").realpath.dirname

    use Rack::Session::Cookie, key: "<%= config[:underscored_project_name] %>.session", secret: self["core.settings"].session_secret

    plugin :csrf, raise: true
    plugin :flash
    plugin :dry_view

    route do |r|
      r.multi_route

      r.root do
        r.view "welcome"
      end
    end

    error do |e|
      self.class[:rack_monitor].instrument(:error, exception: e)
      raise e
    end

    load_routes!
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dry-web-roda-0.7.3 lib/dry/web/roda/templates/subapp/application.rb.tt
dry-web-roda-0.7.2 lib/dry/web/roda/templates/subapp/application.rb.tt
dry-web-roda-0.7.1 lib/dry/web/roda/templates/subapp/application.rb.tt
dry-web-roda-0.7.0 lib/dry/web/roda/templates/subapp/application.rb.tt