Created
January 14, 2011 04:37
-
-
Save hdp/779180 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
use Plack::App::Cascade; | |
my $app = Plack::App::Cascade->new; | |
$app->add(sub { | |
my $env = shift; | |
return sub { | |
my $respond = shift; | |
my $writer = $respond->([404, []]); | |
$writer->write("boo"); | |
$writer->close; | |
}; | |
}); | |
$app->add(sub { | |
my $env = shift; | |
return sub { | |
my $respond = shift; | |
my $writer = $respond->([200,[]]); | |
$writer->write("yay"); | |
$writer->close; | |
} | |
}); | |
$app->to_app; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment