class
Zipstream::StaticFileHandler
- Zipstream::StaticFileHandler
- Reference
- Object
Overview
A handler that lists directories and serves files under a given public directory.
This handler can send precompressed content, if the client accepts it, and a file
with the same name and .gz
extension appended is found in the same directory.
Precompressed files are only served if they are newer than the original file.
NOTE To use StaticFileHandler
, you must explicitly import it with require "http"
Included Modules
- HTTP::Handler
Defined in:
zipstream/http/server/handlers/static_file_handler.crConstructors
-
.new(public_dir : String, fallthrough : Bool = true, directory_listing : Bool = true, match_hidden : Bool = false, follow_symlinks : Bool = false)
Creates a handler that will serve files in the given public_dir, after expanding it (using
File#expand_path
). -
.new(public_dir : String, fallthrough = true, directory_listing = true)
Creates a handler that will serve files in the given public_dir, after expanding it (using
File#expand_path
).DEPRECATED
Instance Method Summary
Constructor Detail
Creates a handler that will serve files in the given public_dir, after
expanding it (using File#expand_path
).
If fallthrough is false
, this handler does not call next handler when
request method is neither GET or HEAD, then serves 405 Method Not Allowed
.
Otherwise, it calls next handler.
If directory_listing is false
, directory listing is disabled. This means that
paths matching directories are ignored and next handler is called.
If match_hidden is true
the pattern will match hidden files and folders.
If follow_symlinks is true
the pattern will follow symlinks.
DEPRECATED