Mojolicious::Static - Serve Static Files
use Mojolicious::Static;
Mojolicious::Static is a dispatcher for static files with Range and If-Modified-Since support.
Range
If-Modified-Since
Mojolicious::Static has a few popular static files bundled.
amelia.png
Amelia Perl logo.
Copyright (C) 2010-2011, Sebastian Riedel.
Licensed under the CC-SA License, Version 3.0 http://creativecommons.org/licenses/by-sa/3.0.
favicon.ico
Mojolicious favicon.
Licensed under the CC-ND License, Version 3.0 http://creativecommons.org/licenses/by-nc-nd/3.0.
mojolicious-arrow.png
Mojolicious arrow for not_found template.
not_found
mojolicious-black.png
Black Mojolicious logo.
mojolicious-box.png
Mojolicious box for not_found template.
mojolicious-clouds.png
Mojolicious clouds for not_found template.
mojolicious-pinstripe.gif
Mojolicious pinstripe effect for multiple templates.
mojolicious-white.png
White Mojolicious logo.
css/prettify-mojo.css
Mojolicious theme for prettify.js.
prettify.js
/js/jquery.js
Version 1.4.4
jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.
Copyright 2010, John Resig.
Licensed under the MIT License, http://creativecommons.org/licenses/MIT.
/js/prettify.js
Version 21-Jul-2010
A Javascript module and CSS file that allows syntax highlighting of source code snippets in an html page.
Copyright (C) 2006, Google Inc.
Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0.
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.
DATA
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.
dispatch
my $success = $static->dispatch($c);
Dispatch a Mojolicious::Controller object.
serve
my $success = $static->serve($c, 'foo/bar.html');
Serve a specific file.
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
To install Mojolicious, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious
CPAN shell
perl -MCPAN -e shell install Mojolicious
For more information on module installation, please visit the detailed CPAN module installation guide.