X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FWeb%2FSimple%2FApplication.pm;h=65919ad4cb97bf7c29581db9ee9b1f6eaba1d9a2;hb=ea54c010c46fee647172945fae6dd4523ff6ffd2;hp=fc72cd0d2e37c2bb57b0af594dfdb5f086adbc3d;hpb=e5250d96fc8320272ab2ddc39b445649f980815f;p=catagits%2FWeb-Simple.git diff --git a/lib/Web/Simple/Application.pm b/lib/Web/Simple/Application.pm index fc72cd0..65919ad 100644 --- a/lib/Web/Simple/Application.pm +++ b/lib/Web/Simple/Application.pm @@ -25,7 +25,6 @@ has '_dispatcher' => (is => 'lazy'); sub _build__dispatcher { my $self = shift; require Web::Dispatch; - require Web::Simple::DispatchNode; my $final = $self->_build_final_dispatcher; # We need to weaken both the copy of $self that the @@ -37,13 +36,12 @@ sub _build__dispatcher { # closes back over $self weaken($self); - my $node_args = { app_object => $self }; - weaken($node_args->{app_object}); - Web::Dispatch->new( + my %dispatch_args = ( dispatch_app => sub { $self->dispatch_request(@_), $final }, - node_class => 'Web::Simple::DispatchNode', - node_args => $node_args + dispatch_object => $self ); + weaken($dispatch_args{dispatch_object}); + Web::Dispatch->new(%dispatch_args); } sub _build_final_dispatcher { @@ -326,11 +324,10 @@ for use via L and L. If you want to globally add middleware, you can override this method: use Web::Simple 'HelloWorld'; - use Plack::Builder; { package HelloWorld; - + use Plack::Builder; around 'to_psgi_app', sub { my ($orig, $self) = (shift, shift);