Skip to content

Instantly share code, notes, and snippets.

@hdp
Created January 14, 2011 04:37
Show Gist options
  • Save hdp/779180 to your computer and use it in GitHub Desktop.
Save hdp/779180 to your computer and use it in GitHub Desktop.
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