Skip to content

Instantly share code, notes, and snippets.

@maspalio
Created December 17, 2015 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maspalio/b81878ac71e7f6be3e5a to your computer and use it in GitHub Desktop.
Save maspalio/b81878ac71e7f6be3e5a to your computer and use it in GitHub Desktop.
#!/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