Created
December 17, 2015 10:11
-
-
Save maspalio/b81878ac71e7f6be3e5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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