Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 180 lines (129 sloc) 6.117 kB
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
1 NAME
fd0f167 @miyagawa update docs
miyagawa authored
2 Plack - Perl Superglue for Web frameworks and Web Servers (PSGI toolkit)
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
3
4 DESCRIPTION
8e1a944 @miyagawa Checking in changes prior to tagging of version 0.9940.
miyagawa authored
5 Plack is a set of tools for using the PSGI stack. It contains middleware
d9c779c @miyagawa mentions Paste
miyagawa authored
6 components, a reference server and utilities for Web application
7 frameworks. Plack is like Ruby's Rack or Python's Paste for WSGI.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
8
8c1aa81 @miyagawa Checking in changes prior to tagging of version 0.9021. Changelog di…
miyagawa authored
9 See PSGI for the PSGI specification and PSGI::FAQ to know what PSGI and
10 Plack are and why we need them.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
11
12 MODULES AND UTILITIES
fd0f167 @miyagawa update docs
miyagawa authored
13 Plack::Handler
14 Plack::Handler and its subclasses contains adapters for web servers. We
0efaf24 @miyagawa Checking in changes prior to tagging of version 0.9932.
miyagawa authored
15 have adapters for the built-in standalone web server HTTP::Server::PSGI,
16 CGI, FCGI, Apache1, Apache2, Net::FastCGI and HTTP::Server::Simple
17 included in the core Plack distribution.
18
19 There are also many HTTP server implementations on CPAN that has Plack
20 handlers.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
21
fd0f167 @miyagawa update docs
miyagawa authored
22 See Plack::Handler how to write your own adapters.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
23
24 Plack::Loader
0efaf24 @miyagawa Checking in changes prior to tagging of version 0.9932.
miyagawa authored
25 Plack::Loader is a loader to load one of Plack::Handler adapters and run
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
26 PSGI application code reference with it.
27
28 Plack::Util
29 Plack::Util contains a lot of utility functions for server implementors
30 as well as middleware authors.
31
32 .psgi files
33 PSGI application is a code reference but it's not easy to pass code
34 reference in the command line or configuration files, so Plack uses a
35 convention that you need a file named "app.psgi" or alike, which would
36 be loaded (via perl's core function "do") to return the PSGI application
d7499e3 @miyagawa improve .psgi files documentation
miyagawa authored
37 code reference.
38
39 # Hello.psgi
40 my $app = sub {
41 my $env = shift;
42 # ...
43 return [ $status, $headers, $body ];
44 };
45
46 If you use a web framework, chances are that they provide a helper
47 utility to automatically generate these ".psgi" files for you, such as:
48
49 # MyApp.psgi
50 use MyApp;
51 my $app = sub { MyApp->run_psgi(@_) };
52
53 It's important that the return value of ".psgi" file is the code
8e1a944 @miyagawa Checking in changes prior to tagging of version 0.9940.
miyagawa authored
54 reference. See "eg/dot-psgi" directory for more examples of ".psgi"
55 files.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
56
0f1a389 @miyagawa Checking in changes prior to tagging of version 0.9026. Changelog di…
miyagawa authored
57 plackup, Plack::Runner
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
58 plackup is a command line launcher to run PSGI applications from command
59 line using Plack::Loader to load PSGI backends. It can be used to run
60 standalone servers and FastCGI daemon processes. Other server backends
61 like Apache2 needs a separate configuration but ".psgi" application file
62 can still be the same.
63
0f1a389 @miyagawa Checking in changes prior to tagging of version 0.9026. Changelog di…
miyagawa authored
64 If you want to write your own frontend that replaces, or adds
65 functionalities to plackup, take a look at Plack::Runner module.
66
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
67 Plack::Middleware
68 PSGI middleware is a PSGI application that wraps existent PSGI
69 application and plays both side of application and servers. From the
70 servers the wrapped code reference still looks like and behaves exactly
71 the same as PSGI applications.
72
73 Plack::Middleware gives you an easy way to wrap PSGI applications with a
74 clean API, and compatibility with Plack::Builder DSL.
75
76 Plack::Builder
fb031b2 @miyagawa remove feature() and make them all required to be less annoying
miyagawa authored
77 Plack::Builder gives you a DSL that you can enable Middleware in ".psgi"
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
78 files to wrap existent PSGI applications.
79
80 Plack::Request, Plack::Response
81 Plack::Request gives you a nice wrapper API around PSGI $env hash to get
82 headers, cookies and query parameters much like Apache::Request in
83 mod_perl.
84
85 Plack::Response does the same to construct the response array reference.
86
87 Plack::Test
88 Plack::Test is an unified interface to test your PSGI application using
89 standard HTTP::Request and HTTP::Response pair with simple callbacks.
90
91 Plack::Test::Suite
92 Plack::Test::Suite is a test suite to test a new PSGI server backend.
93
8c1aa81 @miyagawa Checking in changes prior to tagging of version 0.9021. Changelog di…
miyagawa authored
94 CONTRIBUTING
95 Patches and Bug Fixes
96 Small patches and bug fixes can be either submitted via nopaste on IRC
25646f2 @miyagawa update CONTRIBUTING
miyagawa authored
97 <irc://irc.perl.org/#plack> or the github issue tracker
98 <http://github.com/miyagawa/Plack/issues>. Forking on github
99 <http://github.com/miyagawa/Plack> is another good way if you intend to
100 make larger fixes.
101
102 See also <http://contributing.appspot.com/plack> when you think this
103 document is terribly outdated.
8c1aa81 @miyagawa Checking in changes prior to tagging of version 0.9021. Changelog di…
miyagawa authored
104
105 Module Namespaces
106 Modules added to the Plack:: sub-namespaces should be reasonably generic
4398f4e @miyagawa Checking in changes prior to tagging of version 0.9022. Changelog di…
miyagawa authored
107 components which are useful as building blocks and not just simply using
8c1aa81 @miyagawa Checking in changes prior to tagging of version 0.9021. Changelog di…
miyagawa authored
108 Plack.
109
110 Middleware authors are free to use the Plack::Middleware:: namespace for
111 their middleware components. Middleware must be written in the pipeline
112 style such that they can chained together with other middleware
113 components. The Plack::Middleware:: modules in the core distribution are
114 good examples of such modules. It is recommended that you inherit from
115 Plack::Middleware for these types of modules.
116
117 Not all middleware components are wrappers, but instead are more like
118 endpoints in a middleware chain. These types of components should use
119 the Plack::App:: namespace. Again, look in the core modules to see
120 excellent examples of these (Plack::App::File, Plack::App::Directory,
121 etc.). It is recommended that you inherit from Plack::Component for
122 these types of modules.
123
9d1f776 @miyagawa added notes about Task::Plack in Makefile.PL
miyagawa authored
124 DO NOT USE Plack:: namespace to build a new web application or a
125 framework. It's like naming your application under CGI:: namespace if
8e1a944 @miyagawa Checking in changes prior to tagging of version 0.9940.
miyagawa authored
126 it's supposed to run on CGI and that is a really bad choice and would
127 confuse people badly.
9d1f776 @miyagawa added notes about Task::Plack in Makefile.PL
miyagawa authored
128
e8ebfd2 @miyagawa regen README
miyagawa authored
129 AUTHOR
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored
130 Tatsuhiko Miyagawa
131
a0e47b2 @miyagawa change the order so M::I can pick it up correctly
miyagawa authored
132 COPYRIGHT
99898d3 @miyagawa Checking in changes prior to tagging of version 0.9935.
miyagawa authored
133 The following copyright notice applies to all the files provided in this
134 distribution, including binary files, unless explicitly noted otherwise.
135
a0e47b2 @miyagawa change the order so M::I can pick it up correctly
miyagawa authored
136 Copyright 2009-2010 Tatsuhiko Miyagawa
137
e8ebfd2 @miyagawa regen README
miyagawa authored
138 CONTRIBUTORS
139 Yuval Kogman (nothingmuch)
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored
140
e8ebfd2 @miyagawa regen README
miyagawa authored
141 Tokuhiro Matsuno (tokuhirom)
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored
142
e8ebfd2 @miyagawa regen README
miyagawa authored
143 Kazuhiro Osawa (Yappo)
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored
144
3b9b567 @miyagawa Checking in changes prior to tagging of version 0.99_23.
miyagawa authored
145 Kazuho Oku
e8ebfd2 @miyagawa regen README
miyagawa authored
146
147 Florian Ragwitz (rafl)
148
149 Chia-liang Kao (clkao)
150
151 Masahiro Honma (hiratara)
152
153 Daisuke Murase (typester)
154
155 John Beppu
156
157 Matt S Trout (mst)
158
159 Shawn M Moore (Sartak)
160
161 Stevan Little
162
163 Hans Dieter Pearcey (confound)
164
165 Tomas Doran (t0m)
166
167 mala
168
169 Mark Stosberg
170
171 Aaron Trevena
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
172
173 SEE ALSO
578693f @miyagawa test_requires
miyagawa authored
174 PSGI <http://plackperl.org/>
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
175
176 LICENSE
177 This library is free software; you can redistribute it and/or modify it
178 under the same terms as Perl itself.
179
Something went wrong with that request. Please try again.