Just a simple example using Plack::Builder and Plack::App::File to serve some static files using a Perl-based web server.


use strict;
use warnings;

use Plack::Builder;

use Plack::App::File;
my $app = Plack::App::File->new(root => "www")->to_app;

builder {
      enable "DirIndex", dir_index => 'index.html';

Put this in a directory as app.psgi. Put your HTML files in the 'www' subdirectory. Run plackup and you can visit to see the pages.

In this code we use the Plack::Middleware::DirIndex middleware that handles the files in the given directory.

Check out the other articles on Plack/PSGI.