-
- Distribution: Plack
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository (git clone)
- Issues
- Testers (721 / 3 / 0)
- Kwalitee
- 80.40% Coverage
- License: perl_5
- Perl: v5.8.1
- Activity
- 24 month
- Tools
- Download (185.98Kb) 0
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Tatsuhiko Miyagawa
- Aaron Trevena
- Ævar Arnfjörð Bjarmason
- Akzhan Abdulin
-
Alexandr Ciornii
-
Alex J. G. Burzyński
- Allan Whiteford
- Andrew Fresh
- Andrew Rodland
- Andy Wardley
-
Aristotle Pagaltzis
-
Arthur Axel 'fREW' Schmidt
-
Asato Wakisaka
- Ashley Pond V
- Ask Bjørn Hansen
-
ben hengst
-
Ben Morrow
- Bernhard Graf
- Chad Granum
-
chansen
-
Chia-liang Kao
-
cho45
-
Christian Walde
-
chromatic
-
Cosimo Streppone
-
Dagfinn Ilmari Mannsåker
- Daisuke Maki
-
Daisuke Murase
- Dave Marr
-
Dave Rolsky
-
David E. Wheeler
- David Schmidt
- David Steinbrunner
- dmaestro
- Eduardo Arino de la Rubia
- Emmanuel Seyman
- Eric Johnson
-
Eugen Konkov
-
Fabrice Gabolde
-
fayland
- Flavio Poletti
-
Florian Ragwitz
- franck cuny
-
Gianni Ceccarelli
-
Graham Knop
- Grant McLean
- Hans Dieter Pearcey
- Haruka Iwao
- Henry Baragar
-
hiratara
-
HIROSE Masaaki
- Hiroshi Sakai
- Ian Bradley
- Ian Burrell
- Jakob Voss
-
Jay Hannah
-
Jesse Luehrs
-
Jiro Nishiguchi
- Johannes Plunien
- John Beppu
-
John Napiorkowski
-
Jonathan Swartz
- José Pinheiro Neta
- Justin Davis
- kakuno
-
Kang-min Liu
-
Karen Etheridge
-
Kazuho Oku
- Keedi Kim
- Lee Aylward
- Leo Lapworth
- mala
- Marco Pessotto
- Marian Schubert
-
Mark Fowler
-
Mark Stosberg
- Masahiro Chiba
-
Masahiro Nagano
- Michael G. Schwern
- Michal Josef Špaček
- mickey
- Narsimham Chelluri
-
Nick Wellnhofer
- Nobuo Danjou
- Olaf Alders
-
Oliver Gorwits
- Oliver Paukstadt
- Oliver Trosien
-
Olivier Mengué
- osfameron
- Panu Ervamaa
- Paul Driver
-
Pedro Melo
-
Perlover
- Peter Flanigan
-
Peter Makholm
-
Piotr Roszatycki
-
punytan
-
Rafael Kitover
-
Randy Stauner
- Ray Miller
- Richard Simões
- Ricky Morse
-
Robert Rothenberg
- Rob Hoelz
- runarb
-
Ryo Miyake
-
Sawyer X
- Scott S. McCoy
- Shawn M Moore
-
Shoichi Kaji
- smcmurray
- Stephen Clouse
- Stevan Little
- Stuart A Johnston
- Takeshi OKURA
- The Dumb Terminal
- Thomas Klausner
-
Thomas Sibley
-
Tim Bunce
- Tokuhiro Matsuno
-
Tomas Doran
- Tom Heady
- vti
- Wallace Reis
- xaicron
- Yann Kerherve
- yappo
-
Yury Zavarin
-
Yuval Kogman
- 唐鳳
- Dependencies
- Apache::LogFormat::Compiler
- Cookie::Baker
- Devel::StackTrace
- Devel::StackTrace::AsHTML
- File::ShareDir
- Filesys::Notify::Simple
- Hash::MultiValue
- HTTP::Entity::Parser
- HTTP::Headers::Fast
- HTTP::Message
- HTTP::Tiny
- parent
- Pod::Usage
- Stream::Buffered
- Test::TCP
- Try::Tiny
- URI
- WWW::Form::UrlEncoded
- CPAN Testers List
- Reverse dependencies
- Dependency graph
NAME
Plack::App::File - Serve static files from root directory
SYNOPSIS
use Plack::App::File;
my $app = Plack::App::File->new(root => "/path/to/htdocs")->to_app;
# Or map the path to a specific file
use Plack::Builder;
builder {
mount "/favicon.ico" => Plack::App::File->new(file => '/path/to/favicon.ico')->to_app;
};
DESCRIPTION
This is a static file server PSGI application, and internally used by Plack::Middleware::Static. This application serves file from document root if the path matches with the local file. Use Plack::App::Directory if you want to list files in the directory as well.
CONFIGURATION
- root
-
Document root directory. Defaults to
.(current directory) - file
-
The file path to create responses from. Optional.
If it's set the application would ALWAYS create a response out of the file and there will be no security check etc. (hence fast). If it's not set, the application uses
rootto find the matching file. - encoding
-
Set the file encoding for text files. Defaults to
utf-8. - content_type
-
Set the file content type. If not set Plack::MIME will try to detect it based on the file extension or fall back to
text/plain. Can be set to a callback which should work on $_[0] to check full path file name.
AUTHOR
Tatsuhiko Miyagawa
SEE ALSO
Plack::Middleware::Static Plack::App::Directory
Module Install Instructions
To install Plack::App::File, copy and paste the appropriate command in to your terminal.
cpanm Plack
perl -MCPAN -e shell
install Plack
For more information on module installation, please visit the detailed CPAN module installation guide.