The L<PSGI> specification defines an interface between web servers and
Perl-based web applications and frameworks. It supports the writing of
portable applications that can be run using various methods (as a
-standalone server, or using mod_perl, FastCGI, etc.). L<Plack> is a set
-of middleware tools for running Perl applications compatible with the
-PSGI specification.
+standalone server, or using mod_perl, FastCGI, etc.). L<Plack> is an
+implementation of the PSGI specification for running Perl applications.
Catalyst used to contain an entire set of C<< Catalyst::Engine::XXXX >>
classes to handle various web servers and environments (e.g. CGI,
use warnings;
use TestApp;
- my $app = sub { TestApp->psgi_app(@_) };
+ my $app = TestApp->psgi_app(@_);
Note that Catalyst will apply a number of middleware components for you
automatically, and these B<will not> be applied if you manually create a
=head2 What is in the .psgi file Catalyst generates by default?
-Catalyst generates an application which, if the C<< using_frontend_proxy
->> setting is on, is wrapped in L<Plack::Middleware::ReverseProxy>, and
+Catalyst generates an application which, if the C<using_frontend_proxy>
+setting is on, is wrapped in L<Plack::Middleware::ReverseProxy>, and
contains some engine-specific fixes for uniform behaviour, as contained
in:
=item L<Plack::Middleware::IIS6ScriptNameFix>
-=item nginx - local to Catalyst
-
=back
If you override the default by providing your own C<< .psgi >> file,
in the default middlewares if you want this behaviour and you are providing
your own .psgi file.
+This means that the auto-generated (no .psgi file) code looks something
+like this:
+
+ use strict;
+ use warnings;
+ use TestApp;
+
+ my $app = TestApp->apply_default_middlewares(TestApp->psgi_app(@_));
+
=head1 SEE ALSO
L<Catalyst::Upgrading>, L<Plack>, L<PSGI::FAQ>, L<PSGI>.