Skip Menu |

This queue is for tickets about the CGI-Snapp CPAN distribution.

Report information
The Basics
Id: 119072
Status: open
Priority: 0/
Queue: CGI-Snapp

People
Owner: Nobody in particular
Requestors: PERLMAX [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.01
Fixed in: (no value)



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
Subject: Re: [rt.cpan.org #119072] psgi_app doesn't work
Date: Wed, 30 Nov 2016 23:48:46 +1100
To: bug-CGI-Snapp [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Max Perhaps you need CGI::Snapp::Dispatch as documented here: https://metacpan.org/pod/distribution/CGI-Snapp/lib/CGI/Snapp.pm#psgi_app-args_to_new On 30/11/16 23:32, Maximilian Lika via RT wrote: Show quoted text
> Wed Nov 30 07:32:34 2016: Request 119072 was acted upon. > Transaction: Ticket created by PERLMAX > Queue: CGI-Snapp > Subject: psgi_app doesn't work > Broken in: 2.01 > Severity: Normal > Owner: Nobody > Requestors: PERLMAX@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119072 > > > > 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 >
-- Ron Savage - savage.net.au
oh... That means CGI::Snapp without CGI::Snapp::Dispatch cannot handle PSGI with setting the runmode by path_info? This is a very big difference to CGI::Application.. For testing CGI::Snapp::Dispatch I will need some time.. I have to study the Dispatch things, first..
Subject: Re: [rt.cpan.org #119072] psgi_app doesn't work
Date: Thu, 1 Dec 2016 08:44:58 +1100
To: bug-CGI-Snapp [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Max On 01/12/16 00:05, Maximilian Lika via RT wrote: Show quoted text
> Queue: CGI-Snapp > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119072 > > > oh... That means CGI::Snapp without CGI::Snapp::Dispatch cannot handle PSGI with setting the runmode by path_info? This is a very big difference to CGI::Application.. > For testing CGI::Snapp::Dispatch I will need some time.. I have to study the Dispatch things, first..
Yes. In that sense it's a limitation. But search for CGI::Snapp::Demo on MetaCPAN to see all my demos :-). -- Ron Savage - savage.net.au