Compiler-Parser

 view release on metacpan or  search on metacpan

t/app/Plack/App/Cascade.t  view on Meta::CPAN

411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
Plack::App::Cascade - Cascadable compound application
 
=head1 SYNOPSIS
 
  use Plack::App::Cascade;
  use Plack::App::URLMap;
  use Plack::App::File;
 
  # Serve static files from multiple search paths
  my $cascade = Plack::App::Cascade->new;
  $cascade->add( Plack::App::File->new(root => "/www/example.com/foo")->to_app );
  $cascade->add( Plack::App::File->new(root => "/www/example.com/bar")->to_app );
 
  my $app = Plack::App::URLMap->new;
  $app->map("/static", $cascade);
  $app->to_app;
 
=head1 DESCRIPTION
 
Plack::App::Cascade is a Plack middleware component that compounds
several apps and tries them to return the first response that is not
404.
 
=head1 METHODS



( run in 0.691 second using v1.01-cache-2.11-cpan-26ccb49234f )