- App is just a sub
my $app = sub { ... }
- Middleware wraps the sub
my $mw = sub { my($env) = @_; # Mess with $env my $resp = $app->($env); # Mess with $resp return $resp; }
my $app = sub { ... }
my $mw = sub { my($env) = @_; # Mess with $env my $resp = $app->($env); # Mess with $resp return $resp; }