Plack::...:Cascade(3)
β¨ NAME β¨
Plack::App::Cascade β a Cascadable compound application π
(that's the page title up there in the header, bestie, and the manual name is Plack::...:Cascade(3), from the User Contributed Perl Documentation collection π)
π SYNOPSIS π
okay so here's the whole vibe in code, no cap:
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;
likeβ¦ serving static files from multiple search paths?? the way that just works π¦ iconic behavior fr fr
π DESCRIPTION π
Plack::App::Cascade is a Plack middleware component that compounds several apps together and tries them one by one, returning the first response that is not 404. it's giving "I'll ask literally everyone until somebody answers me" π and honestly? slay.
π METHODS π
πΈ new
$app = Plack::App::Cascade->new(apps => [ $app1, $app2 ]);
Creates a new Cascade application. that's it, that's the birth story π«Ά
π add
$app->add($app1);
$app->add($app2, $app3);
Appends a new application to the list of apps to try. and bestie, you can pass multiple apps to the one add call β go off, be efficient π
π¦ catch
$app->catch([ 403, 404 ]);
Sets which error codes to catch and process onwards. Defaults to 404. so if you want 403 in the mix too, you gotta say so yourself β¨
π AUTHOR π
Tatsuhiko Miyagawa</purl> β the original main character, we respect it π
β SEE ALSO β
Plack::App::URLMapRack::Cascade
iykyk π§
and that's the whole page, bestie!! this was perl v5.42.3, dated 2026-10-18, from the Plack::...:Cascade(3) manual β go forth and cascade ur little heart out πβ¨ππ¦πΈπ
π¦ where this page comes from
- fedora 43: perl-Plack 1.0055-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-Plack 1.0055-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms