| Mojolicious documentation | view source | Contained in the Mojolicious distribution. |
Mojolicious::Static - Serve Static Files
use Mojolicious::Static;
Mojolicious::Static is a dispatcher for static files with Range and
If-Modified-Since support.
Mojolicious::Static implements the following attributes.
default_static_class my $class = $static->default_static_class;
$static = $static->default_static_class('main');
The dispatcher will use this class to look for files in the DATA section.
root my $root = $static->root;
$static = $static->root('/foo/bar/files');
Directory to serve static files from.
Mojolicious::Static inherits all methods from Mojo::Base and implements the following ones.
dispatchmy $success = $static->dispatch($c);
Dispatch a Mojolicious::Controller object.
servemy $success = $static->serve($c, 'foo/bar.html');
Serve a specific file.
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
| Mojolicious documentation | view source | Contained in the Mojolicious distribution. |