Marquee Marquee::Static - Static server

TABLE OF CONTENTS

NAME

Marquee::Static - Static server

SYNOPSIS

my $static = Maruqee::Static->new;
$static->maxage(3600);
$static->serve('/path/to/file.png');

DESCRIPTION

Marquee::Static represents static file server.

ATTRIBUTES

Marquee::Static implements the following attributes.

maxage

$static->maxage(3600);

roots

Root array for searching static files.

$dynamic->roots(['path/to/dir1', 'path/to/dir1']);
my $roots = $dynamic->roots;

INSTANCE METHODS

Marquee::Static implements the following instance methods.

search

Searches for static files for given path and returns the path if exists. The search is made within the directories out of "roots" attribute.

my $path = $static->search('./a.html'); # /path/to/document_root/a.html
my $path = $static->search('/path/to/a.html'); # /path/to/a.html

serve

Serves static file.

$static->serve('/path/to/static.png');

SEE ALSO

Marquee, Mojolicious