Subject: | psgi_app doesn't work |
Hello Ron Savage,
First thank you very much for your work. It is wonderful that you try to keep this fantastic piece of software alive!
I am at the moment working on CGI::Application and especially trying to use it with PSGI and improving the PSGI support. On this occasion I took a look at CGI::Snapp, but I didn't get working it with PSGI and plackup. The first call with the browser works just fine. But switching between the runmodes doesn't work:
Here is my most simple instance script:
# /usr/bin/perl -wT
use lib ('.');
use WebApp;
my $app = WebApp->psgi_app();
And here is my Test Application:
package WebApp;
use lib ('./extlib2/lib/perl5', './extlib/lib/perl5/');
use base 'CGI::Snapp';
sub setup {
my $self = shift;
$self->start_mode('mode2');
$self->mode_param(path_info => 1);
$self->run_modes(
'mode1' => 'do_stuff',
'mode2' => 'do_more_stuff',
'mode3' => 'do_something_else'
);
}
sub do_stuff {
my $self = shift;
my $q = $self->query();
my $output = 'Hallo Welt';
return $output;
}
sub do_more_stuff {
my $self = shift;
my $output = '';
$output .= "mode2 selected";
}
sub do_something_else {
my $self = shift;
my $q = $self->query();
my $output = '';
$output .= "mode3 selected";
}
I start the Application with "./extlib/bin/plackup ./webapp.psgi" becaus plack is installed under ./extlib.
Best wishes,
Max