Class: Hanami::Middleware::Assets

Inherits:
Rack::Static
  • Object
show all
Defined in:
gems/gems/hanami-2.1.0/lib/hanami/middleware/assets.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}, config: Hanami.app.config) ⇒ Assets

Returns a new instance of Assets

def initialize(app, options = {}, config: Hanami.app.config)
  root = config.actions.public_directory
  urls = [config.assets.path_prefix]

  defaults = {
    root: root,
    urls: urls
  }

  super(app, defaults.merge(options))
end