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
# 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 {
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);