The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

HTTP::Server::Simple::Static - Serve static files with HTTP::Server::Simple

SYNOPSIS

  my %upload = $r->upload('file');
  return unless $upload{mimetype} =~ m|^image/|;

DESCRIPTION

this mixin adds a method to serve static files from your HTTP::Server::Simple subclass.

METHODS

serve_static

Takes a base directory and a web path, and tries to serve a static file.

SEE ALSO

AUTHOR

Marcus Ramberg marcus@thefeed.no Thanks to Simon Cozens for initial implementation.

LICENSE

You may distribute this code under the same terms as Perl itself.