Sha256: 1fb47270efabc6d9b74eb5b45feb88835a7580eb367a701b96c520250cb76e22
Contents?: true
Size: 1.42 KB
Versions: 2
Compression:
Stored size: 1.42 KB
Contents
require "web_pipe" require 'web_pipe/plugs/content_type' require "web_pipe/plugs/config" require "rack/csrf" require "rack/session/cookie" require 'rack-flash' require "<%= config[:underscored_umbrella_name] %>/<%= config[:underscored_project_name] %>/container" WebPipe.load_extensions( :container, :cookies, :flash, :dry_schema, :dry_view, :params, :redirect, :router_params, :session, :url ) module <%= config[:camel_cased_umbrella_name] %> module <%= config[:camel_cased_app_name] %> class Web include WebPipe use :cookies, Rack::Session::Cookie, key: "<%= config[:underscored_project_name] %>.session", secret: Container["core.settings"].session_secret use :csrf, Rack::Csrf, raise: true use :flash, Rack::Flash plug :config, WebPipe::Plugs::Config.( container: Container, view_context: lambda do |conn| { flash: conn.flash, csrf_token: Rack::Csrf.token(conn.env), csrf_metatag: Rack::Csrf.metatag(conn.env), csrf_tag: Rack::Csrf.tag(conn.env) } end, sanitization_handler: lambda do |conn, result| conn. set_status(500). set_response_body("Params #{conn.params} do not conform with the schema: #{result.errors.inspect}"). halt end ) plug :content_type, WebPipe::Plugs::ContentType.('text/html') end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
dry-web-web_pipe-0.2.0 | lib/dry/web/web_pipe/templates/subapp/web.rb.tt |
dry-web-web_pipe-0.1.0 | lib/dry/web/web_pipe/templates/subapp/web.rb.tt |