class OodAppkit::FilesRackApp
Middleware that serves entries below the ‘root` given, according to the path info of the Rack request. @see www.rubydoc.info/github/rack/rack/master/Rack/Directory Descripton of `Rack::Directory`
Attributes
root[RW]
The root path on file system that this app serves entries from below @return [String] the root path
Public Class Methods
new(root: OodAppkit.dataroot)
click to toggle source
@param root [String, to_s] the root path
# File lib/ood_appkit/files_rack_app.rb, line 11 def initialize(root: OodAppkit.dataroot) @root = root.to_s end
Public Instance Methods
call(env)
click to toggle source
Use ‘Rack::Directory` as middleware with `root` set as `dataroot` by default
# File lib/ood_appkit/files_rack_app.rb, line 17 def call(env) Rack::Directory.new(root).call(env) end