Class: RackStaticApp::Static

Inherits:
Vienna::Static
  • Object
show all
Defined in:
lib/rackstaticapp.rb

Overview

RackStaticApp::Static is just a wrapper for Rack::Static with sane and opinionated options.

It serves all files under the given root and doesn’t passes on requests for files that don’t exist.

Examples

use RackStaticApp::Static, 'public'

Instance Method Summary collapse

Constructor Details

#initialize(app, root) ⇒ Static

Returns a new instance of Static.



36
37
38
# File 'lib/rackstaticapp.rb', line 36

def initialize(app, root)
  super
end

Instance Method Details

#header_rulesObject



52
53
54
# File 'lib/rackstaticapp.rb', line 52

def header_rules
  super
end

#indexObject



48
49
50
# File 'lib/rackstaticapp.rb', line 48

def index
  super
end

#optionsObject



56
57
58
# File 'lib/rackstaticapp.rb', line 56

def options
  {urls: urls, root: root, index: index, header_rules: header_rules, cascade: true}
end

#rootObject



44
45
46
# File 'lib/rackstaticapp.rb', line 44

def root
  super
end

#urlsObject



40
41
42
# File 'lib/rackstaticapp.rb', line 40

def urls
  [""]
end