Merge branch 'pr/135' into release-candidates/rc-5.90116
[catagits/Catalyst-Runtime.git] / lib / Catalyst / PSGI.pod
index b12b76b..a05e002 100644 (file)
@@ -9,9 +9,8 @@ Catalyst::PSGI - How Catalyst and PSGI work together
 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,
@@ -53,7 +52,7 @@ The simplest C<.psgi> file for an application called C<TestApp> would be:
     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
@@ -64,8 +63,8 @@ L<http://search.cpan.org/dist/Plack/lib/Plack.pm#.psgi_files>
 
 =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:
 
@@ -75,8 +74,6 @@ in:
 
 =item L<Plack::Middleware::IIS6ScriptNameFix>
 
-=item nginx - local to Catalyst
-
 =back
 
 If you override the default by providing your own C<< .psgi >> file,
@@ -89,6 +86,15 @@ An apply_default_middlewares method is supplied to wrap your application
 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>.