Skip to content

Instantly share code, notes, and snippets.

@maspalio maspalio/app.psgi
Created Dec 17, 2015

Embed
What would you like to do?
#!/usr/bin/env perl
use strict;
use warnings;
use Plack::App::Directory;
use Plack::Builder;
my $pad = Plack::App::Directory->new->to_app;
my $app = sub {
my $env = shift;
$env->{PATH_INFO} = '/index.html' if $env->{PATH_INFO} eq '/';
$pad->( $env );
};
builder {
enable 'Plack::Middleware::Static', path => qr{^/(css|data|js)/}, root => '.';
$app;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.