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
The root path on file system that this app serves entries from below @return [String] the root path
Public Class Methods
Source
# File lib/ood_appkit/files_rack_app.rb, line 11 def initialize(root: OodAppkit.dataroot) @root = root.to_s end
@param root [String, to_s] the root path
Public Instance Methods
Source
# File lib/ood_appkit/files_rack_app.rb, line 17 def call(env) Rack::Directory.new(root).call(env) end
Use ‘Rack::Directory` as middleware with `root` set as `dataroot` by default