Peter Sergeant


CatalystX::PSGIApp - Get a psgi_app in a unified way across different Catalyst versions


version 0.01


Provides a psgi_app via ->psgi_app if it's available, or via Catalyst::Engine::PSGI if it's not


To use Catalyst with PSGI on Catalyst versions pre 5.9 requires the use of Catalyst::Engine::PSGI. Version 5.9 (and presumably above) of Catalyst have PSGI baked in, and provide a psgi_app method.

If your Catalyst app is being run on versions on both side of this divide - which is a weird use-case you probably shouldn't have - this module allows you a unified way of getting the PSGI app back.


You'll need to use Catalyst::Engine::PSGI installed for this to work with older Catalysts, but it's not listed as a dependency.

If you need this module, your developers are using different Catalyst versions to develop against, which is pretty weird.

As per Catalyst::PSGI, Catalyst using the default .psgi file will add several default middlewares - as we use the app_psgi method explicitly, these will not be added. See Catalyst::PSGI for details.


 use CatalystX::PSGIApp;
 my $app = CatalystX::PSGIApp->psgi_app( 'Your::App::Here' );



Returns a PSGI app, either via <-psgi_app>> if your version of Catalyst supports it, or using Catalyst::Engine::PSGI.


Peter Sergeant, while at|NET-A-PORTER.