The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mojolicious::Static - Serve Static Files

SYNOPSIS

    use Mojolicious::Static;

DESCRIPTION

Mojolicious::Static is a dispatcher for static files with Range and If-Modified-Since support.

FILES

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.

    Copyright (C) 2010-2011, Sebastian Riedel.

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.

    Copyright (C) 2010-2011, Sebastian Riedel.

Licensed under the CC-ND License, Version 3.0 http://creativecommons.org/licenses/by-nc-nd/3.0.

mojolicious-black.png

Black Mojolicious logo.

    Copyright (C) 2010-2011, Sebastian Riedel.

Licensed under the CC-ND License, Version 3.0 http://creativecommons.org/licenses/by-nc-nd/3.0.

mojolicious-box.png

Mojolicious box for not_found template.

    Copyright (C) 2010-2011, Sebastian Riedel.

Licensed under the CC-ND License, Version 3.0 http://creativecommons.org/licenses/by-nc-nd/3.0.

mojolicious-clouds.png

Mojolicious clouds for not_found template.

    Copyright (C) 2010-2011, Sebastian Riedel.

Licensed under the CC-ND License, Version 3.0 http://creativecommons.org/licenses/by-nc-nd/3.0.

mojolicious-pinstripe.gif

Mojolicious pinstripe effect for multiple templates.

    Copyright (C) 2010-2011, Sebastian Riedel.

Licensed under the CC-ND License, Version 3.0 http://creativecommons.org/licenses/by-nc-nd/3.0.

mojolicious-white.png

White Mojolicious logo.

    Copyright (C) 2010-2011, Sebastian Riedel.

Licensed under the CC-ND License, Version 3.0 http://creativecommons.org/licenses/by-nc-nd/3.0.

css/prettify-mojo.css

Mojolicious theme for prettify.js.

    Copyright (C) 2010-2011, Sebastian Riedel.

Licensed under the CC-ND License, Version 3.0 http://creativecommons.org/licenses/by-nc-nd/3.0.

/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.

ATTRIBUTES

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.

METHODS

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.

SEE ALSO

Mojolicious, Mojolicious::Guides, http://mojolicio.us.