Skip to content

Instantly share code, notes, and snippets.

@keisatou
Created November 4, 2013 08:53
Show Gist options
  • Save keisatou/7299880 to your computer and use it in GitHub Desktop.
Save keisatou/7299880 to your computer and use it in GitHub Desktop.
# via: http://search.cpan.org/~miyagawa/Plack-1.0029/lib/Plack/App/Cascade.pm
use Plack::App::Cascade;
use Plack::App::File;
use Plack::A pp::URLMap;
my $cascade = Plack::App::Cascade->new;
$cascade->add(
Plack::App::File->new(root => '/path/to/dir1')->to_app,
Plack::App::File->new(root => '/path/to/dir2')->to_app,
);
my $map = Plack::App::URLMap->new;
$map->mount('/' => $cascade);
$map->to_app;
# via: http://blog.64p.org/entry/20091216/1260966299
plackup -e 'use Plack::App::Directory; Plack::App::Directory->new(root=>q/./)->to_app'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment