Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 193 lines (136 sloc) 6.383 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,
918761e @miyagawa Checking in changes prior to tagging of version 0.99_75.
miyagawa authored
16 CGI, FCGI, Apache1, Apache2 and HTTP::Server::Simple included in the
17 core Plack distribution.
0efaf24 @miyagawa Checking in changes prior to tagging of version 0.9932.
miyagawa authored
18
b943012 @miyagawa Checking in changes prior to tagging of version 0.9976.
miyagawa authored
19 There are also many HTTP server implementations on CPAN that have Plack
0efaf24 @miyagawa Checking in changes prior to tagging of version 0.9932.
miyagawa authored
20 handlers.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
21
b943012 @miyagawa Checking in changes prior to tagging of version 0.9976.
miyagawa authored
22 See Plack::Handler when writing your own adapters.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
23
24 Plack::Loader
b943012 @miyagawa Checking in changes prior to tagging of version 0.9976.
miyagawa authored
25 Plack::Loader is a loader to load one Plack::Handler adapter and run a
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
b943012 @miyagawa Checking in changes prior to tagging of version 0.9976.
miyagawa authored
33 A PSGI application is a code reference but it's not easy to pass code
34 reference via the command line or configuration files, so Plack uses a
35 convention that you need a file named "app.psgi" or similar, which would
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
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
b943012 @miyagawa Checking in changes prior to tagging of version 0.9976.
miyagawa authored
65 functionalities to plackup, take a look at the Plack::Runner module.
0f1a389 @miyagawa Checking in changes prior to tagging of version 0.9026. Changelog di…
miyagawa authored
66
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
67 Plack::Middleware
b943012 @miyagawa Checking in changes prior to tagging of version 0.9976.
miyagawa authored
68 PSGI middleware is a PSGI application that wraps an existing PSGI
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
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
918761e @miyagawa Checking in changes prior to tagging of version 0.99_75.
miyagawa authored
88 Plack::Test is a unified interface to test your PSGI application using
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
89 standard HTTP::Request and HTTP::Response pair with simple callbacks.
90
91 Plack::Test::Suite
9292516 @miyagawa Checking in changes prior to tagging of version 0.9978.
miyagawa authored
92 Plack::Test::Suite is a test suite to test a new PSGI server backend.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
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
0875699 @miyagawa Update URLs
miyagawa authored
98 <http://github.com/plack/Plack/issues>. Forking on github
99 <http://github.com/plack/Plack> is another good way if you intend to
25646f2 @miyagawa update CONTRIBUTING
miyagawa authored
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
f9369ef @miyagawa releng
miyagawa authored
136 Copyright 2009-2011 Tatsuhiko Miyagawa
a0e47b2 @miyagawa change the order so M::I can pick it up correctly
miyagawa authored
137
8655749 @miyagawa Checking in changes prior to tagging of version 0.9991.
miyagawa authored
138 CORE DEVELOPERS
139 Tatsuhiko Miyagawa (miyagawa)
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
96eba53 @miyagawa Checking in changes prior to tagging of version 1.0000.
miyagawa authored
143 Jesse Luehrs (doy)
8655749 @miyagawa Checking in changes prior to tagging of version 0.9991.
miyagawa authored
144
145 Tomas Doran (bobtfish)
146
147 Graham Knop (haarg)
148
149 CONTRIBUTORS
150 Yuval Kogman (nothingmuch)
151
e8ebfd2 @miyagawa regen README
miyagawa authored
152 Kazuhiro Osawa (Yappo)
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored
153
3b9b567 @miyagawa Checking in changes prior to tagging of version 0.99_23.
miyagawa authored
154 Kazuho Oku
e8ebfd2 @miyagawa regen README
miyagawa authored
155
156 Florian Ragwitz (rafl)
157
158 Chia-liang Kao (clkao)
159
160 Masahiro Honma (hiratara)
161
162 Daisuke Murase (typester)
163
164 John Beppu
165
166 Matt S Trout (mst)
167
168 Shawn M Moore (Sartak)
169
170 Stevan Little
171
172 Hans Dieter Pearcey (confound)
173
174 mala
175
176 Mark Stosberg
177
178 Aaron Trevena
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
179
180 SEE ALSO
d6927ad @miyagawa Checking in changes prior to tagging of version 0.9964.
miyagawa authored
181 The PSGI specification upon which Plack is based.
182
183 <http://plackperl.org/>
184
0875699 @miyagawa Update URLs
miyagawa authored
185 The Plack wiki: <https://github.com/plack/Plack/wiki>
d6927ad @miyagawa Checking in changes prior to tagging of version 0.9964.
miyagawa authored
186
0875699 @miyagawa Update URLs
miyagawa authored
187 The Plack FAQ: <https://github.com/plack/Plack/wiki/Faq>
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
188
189 LICENSE
190 This library is free software; you can redistribute it and/or modify it
191 under the same terms as Perl itself.
192
Something went wrong with that request. Please try again.