[cgiapp] testing the new CAD::PSGI version
Ron Savage
ron at savage.net.au
Wed May 18 21:26:40 EDT 2011
Hi Mark
Doesn't work for me.
I assume it's due to the exact combination of modules used and their
parentage.
(1) 1 line change to Local::Application::Controller:
package Local::Application::Controller;
#Patch#use parent 'CGI::Application';
use parent 'CGI::Application::Dispatch::PSGI';
use strict;
use warnings;
...
(2) 2 line change to app.psgi:
#!/usr/bin/env perl
#
# Run with:
# starman -l 127.0.0.1:5002 --workers 1 httpd/cgi-bin/local/app.psgi &
# or, for more debug output:
# plackup -l 127.0.0.1:5002 httpd/cgi-bin/local/app.psgi &
use strict;
use warnings;
#Patch#use CGI::Application::Dispatch::PSGI;
use Local::Application::Controller;
use Plack::Builder;
# ---------------------
#Patch#my($app) = CGI::Application::Dispatch -> as_psgi
my($app) = Local::Application::Controller -> as_psgi
(
prefix => 'Local::Application::Controller',
table =>
[
'' => {app => 'Initialize', rm => 'display'},
':app' => {rm => 'display'},
':app/:rm/:id?' => {},
],
);
builder
{
enable "Plack::Middleware::Static",
path => qr!^/(assets|favicon|yui)/!,
root => '/dev/shm/html';
$app;
};
(3) The error:
[Dispatch] ERROR: Unknown error: Can't locate object method "new" via
package "Local::Application::Controller::Initialize"
at /home/ron/perl5/perlbrew/perls/perl-5.12.2/lib/site_perl/5.12.2/CGI/Application/Dispatch/PSGI.pm line 455.
This'll be because CGI::Application itself is not pulled in.
--
Ron Savage
http://savage.net.au/
Ph: 0421 920 622
More information about the cgiapp
mailing list