The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

CGI::Application::Dispatch::PSGI - PSGI adapter for CGI::Application::Dispatch

SYNOPSIS

CGI::Application::Dispatch is a (not so) simple dispatcher for families of CGI::Application-based applications served under common URL base.

It is a little too high-level to be directly converted to PSGI with CGI::Application::PSGI so the need for a special adapter rose. Here it is.

    ### in your dispatch.psgi:
    use Your::Application::Dispatch;
    use CGI::Application::Dispatch::PSGI;

    Your::Application::Dispatch->as_psgi;

Most of CGI::Application::Dispatch scripts may be converted by simply changing dispatch() method call to as_psgi() call.

The code is a mere mashup of CGI::Application::PSGI and CGI::Application::Emulate::PSGI, so all the good parts here are courtesy of their respective authors but the bugs are all mine.

INTERFACE

When you "use" this package it installs a single additional method as_psgi into CGI::Application::Dispatch which is immediately available to your custom dispatcher class through inheritance.

as_psgi(%args)

This is a constructor for PSGI application sub. It must be called as a method and takes an optional hash with arguments for dispatcher. For additional information about the arguments, see "dispatch(%args)" in CGI::Application::Dispatch.

Example:

    my $app = MyApp::CAP::Dispatch->as_psgi(
        args_to_new => {
            PARAMS => {
                cfg_file => "$cfgdir/myapp.cfg",
            },
        },
    );

AUTHOR

Alex Kapranoff, <kappa at cpan.org>

BUGS

CGI::Application::Dispatch::PSGI was NOT tested under mod_perl. Patches (if need arises) are welcome.

This module was made to use Plack's middlewares during debugging and was never run in production. CGI::Application::Dispatch should really rely less on %ENV.

Please report any bugs or feature requests to bug-cgi-application-dispatch-psgi at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Application-Dispatch-PSGI. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc CGI::Application::Dispatch::PSGI

You can also look for information at:

SEE ALSO

http://plackperl.org, CGI::Application::PSGI, CGI::Application::Emulate::PSGI, CGI::Application::Dispatch::Server.

COPYRIGHT & LICENSE

Copyright 2009 Alex Kapranoff.

This program is released under the following license: GPLv3