Unix and Linux Discussions Tagged with static |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
3 |
18,824 |
Debian |
|
|
|
0 |
2,738 |
Programming |
|
|
|
5 |
2,197 |
Programming |
|
|
|
5 |
25,086 |
IP Networking |
|
|
|
2 |
6,294 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
5,498 |
Programming |
|
|
|
2 |
9,338 |
UNIX for Advanced & Expert Users |
|
|
|
5 |
2,558 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,152 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
2,597 |
Programming |
|
|
|
5 |
2,860 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
6,368 |
IP Networking |
|
|
|
4 |
5,076 |
IP Networking |
|
|
|
1 |
12,109 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
2,688 |
UNIX for Dummies Questions & Answers |
|
|
|
10 |
5,985 |
UNIX for Dummies Questions & Answers |
|
|
|
6 |
3,382 |
IP Networking |
|
|
|
3 |
3,446 |
UNIX for Dummies Questions & Answers |
Mojolicious::Static(3pm) User Contributed Perl Documentation Mojolicious::Static(3pm)
NAME
Mojolicious::Static - Serve static files
SYNOPSIS
use Mojolicious::Static;
my $static = Mojolicious::Static->new;
DESCRIPTION
Mojolicious::Static is a dispatcher for static files with "Range" and "If-Modified-Since" support.
ATTRIBUTES
Mojolicious::Static implements the following attributes.
"classes"
my $classes = $static->classes;
$static = $static->classes(['main']);
Classes to use for finding files in "DATA" sections, first one has the highest precedence, defaults to "main".
# Add another class with static files in DATA section
push @{$static->classes}, 'Mojolicious::Plugin::Fun';
"paths"
my $paths = $static->paths;
$static = $static->paths(['/home/sri/public']);
Directories to serve static files from, first one has the highest precedence.
# Add another "public" directory
push @{$static->paths}, '/home/sri/public';
METHODS
Mojolicious::Static inherits all methods from Mojo::Base and implements the following ones.
"dispatch"
my $success = $static->dispatch(Mojolicious::Controller->new);
Serve static file for Mojolicious::Controller object.
"serve"
my $success = $static->serve(Mojolicious::Controller->new, 'foo/bar.html');
Serve a specific file, relative to "paths" or from "classes".
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojolicious::Static(3pm)