Plack::Middleware::DirIndex
use Plack::Builder; use Plack::App::File; use Plack::Middleware::DirIndex; my $app = Plack::App::File->new({ root => './htdocs/' })->to_app; builder { enable "Plack::Middleware::DirIndex", dir_index => 'index.html'; $app; }
If $env->{PATH_INFO} ends with a '/' then we will append the dir_index value to it (defaults to index.html)
To install Plack::Middleware::DirIndex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Middleware::DirIndex
CPAN shell
perl -MCPAN -e shell install Plack::Middleware::DirIndex
For more information on module installation, please visit the detailed CPAN module installation guide.