Sha256: 9c59834678b78c66e83cafcf320656b896e64652d388146fc9f3794c1f2ddd0f

Contents?: true

Size: 778 Bytes

Versions: 8

Compression:

Stored size: 778 Bytes

Contents

require "rack/csrf"
require "dry/web/roda/application"
require_relative "container"
require "roda_plugins"

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

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

    use Rack::Session::Cookie, key: "<%= config[:underscored_app_name] %>.session", secret: <%= config[:camel_cased_umbrella_name] %>::Container.settings.session_secret
    use Rack::Csrf, raise: true

    plugin :flash

    plugin :view
    plugin :page

    def name
      :<%= config[:underscored_app_name] %>
    end

    route do |r|
      r.multi_route
    end

    load_routes!
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dry-web-roda-0.5.1 lib/dry/web/roda/skeletons/app/system/__underscored_app_name__/application.rb.tt
dry-web-roda-0.5.0 lib/dry/web/roda/skeletons/app/system/__underscored_app_name__/application.rb.tt
dry-web-roda-0.4.0 lib/dry/web/roda/skeletons/app/component/__underscored_app_name__/application.rb.tt
dry-web-roda-0.3.0 lib/dry/web/roda/skeletons/app/component/__underscored_app_name__/application.rb.tt
dry-web-roda-0.2.3 lib/dry/web/roda/skeletons/app/component/__underscored_app_name__/application.rb.tt
dry-web-roda-0.2.2 lib/dry/web/roda/skeletons/app/component/__underscored_app_name__/application.rb.tt
dry-web-roda-0.2.1 lib/dry/web/roda/skeletons/app/component/__underscored_app_name__/application.rb.tt
dry-web-roda-0.2.0 lib/dry/web/roda/skeletons/app/component/__underscored_app_name__/application.rb.tt