Class: Hanami::Middleware::Assets

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

Overview

Since:

  • 0.1.0

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Assets.

Since:

  • 0.1.0



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/hanami/middleware/assets.rb', line 8

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