Skip to content
Newer
Older
100644 186 lines (132 sloc) 6.14 KB
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
1 NAME
fd0f167 @miyagawa update docs
miyagawa authored Jan 15, 2010
2 Plack - Perl Superglue for Web frameworks and Web Servers (PSGI toolkit)
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
3
4 DESCRIPTION
8e1a944 @miyagawa Checking in changes prior to tagging of version 0.9940.
miyagawa authored Jul 2, 2010
5 Plack is a set of tools for using the PSGI stack. It contains middleware
d9c779c @miyagawa mentions Paste
miyagawa authored Feb 1, 2010
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 Sep 30, 2009
8
8c1aa81 @miyagawa Checking in changes prior to tagging of version 0.9021. Changelog dif…
miyagawa authored Dec 8, 2009
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 Sep 30, 2009
11
12 MODULES AND UTILITIES
fd0f167 @miyagawa update docs
miyagawa authored Jan 15, 2010
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 Apr 19, 2010
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 Mar 24, 2011
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 Apr 19, 2010
18
b943012 @miyagawa Checking in changes prior to tagging of version 0.9976.
miyagawa authored Apr 8, 2011
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 Apr 19, 2010
20 handlers.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
21
b943012 @miyagawa Checking in changes prior to tagging of version 0.9976.
miyagawa authored Apr 9, 2011
22 See Plack::Handler when writing your own adapters.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
23
24 Plack::Loader
b943012 @miyagawa Checking in changes prior to tagging of version 0.9976.
miyagawa authored Apr 9, 2011
25 Plack::Loader is a loader to load one Plack::Handler adapter and run a
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
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 Apr 9, 2011
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 Sep 30, 2009
36 be loaded (via perl's core function "do") to return the PSGI application
d7499e3 @miyagawa improve .psgi files documentation
miyagawa authored Feb 9, 2010
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 Jul 3, 2010
54 reference. See "eg/dot-psgi" directory for more examples of ".psgi"
55 files.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
56
0f1a389 @miyagawa Checking in changes prior to tagging of version 0.9026. Changelog dif…
miyagawa authored Jan 1, 2010
57 plackup, Plack::Runner
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
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 dif…
miyagawa authored Jan 1, 2010
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 Apr 9, 2011
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 dif…
miyagawa authored Jan 1, 2010
66
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
67 Plack::Middleware
b943012 @miyagawa Checking in changes prior to tagging of version 0.9976.
miyagawa authored Apr 9, 2011
68 PSGI middleware is a PSGI application that wraps an existing PSGI
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
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 Oct 27, 2009
77 Plack::Builder gives you a DSL that you can enable Middleware in ".psgi"
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
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 Mar 24, 2011
88 Plack::Test is a unified interface to test your PSGI application using
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
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 May 4, 2011
92 Plack::Test::Suite is a test suite to test a new PSGI server backend.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
93
8c1aa81 @miyagawa Checking in changes prior to tagging of version 0.9021. Changelog dif…
miyagawa authored Dec 8, 2009
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 Mar 27, 2010
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 dif…
miyagawa authored Dec 8, 2009
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 dif…
miyagawa authored Dec 13, 2009
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 dif…
miyagawa authored Dec 8, 2009
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 Dec 15, 2009
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 Jul 3, 2010
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 Dec 15, 2009
128
e8ebfd2 @miyagawa regen README
miyagawa authored Feb 6, 2010
129 AUTHOR
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored Oct 21, 2009
130 Tatsuhiko Miyagawa
131
a0e47b2 @miyagawa change the order so M::I can pick it up correctly
miyagawa authored Mar 27, 2010
132 COPYRIGHT
99898d3 @miyagawa Checking in changes prior to tagging of version 0.9935.
miyagawa authored May 5, 2010
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 Feb 9, 2011
136 Copyright 2009-2011 Tatsuhiko Miyagawa
a0e47b2 @miyagawa change the order so M::I can pick it up correctly
miyagawa authored Mar 27, 2010
137
e8ebfd2 @miyagawa regen README
miyagawa authored Feb 6, 2010
138 CONTRIBUTORS
139 Yuval Kogman (nothingmuch)
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored Oct 21, 2009
140
e8ebfd2 @miyagawa regen README
miyagawa authored Feb 6, 2010
141 Tokuhiro Matsuno (tokuhirom)
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored Oct 21, 2009
142
e8ebfd2 @miyagawa regen README
miyagawa authored Feb 6, 2010
143 Kazuhiro Osawa (Yappo)
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored Oct 21, 2009
144
3b9b567 @miyagawa Checking in changes prior to tagging of version 0.99_23.
miyagawa authored Mar 27, 2010
145 Kazuho Oku
e8ebfd2 @miyagawa regen README
miyagawa authored Feb 6, 2010
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 Sep 30, 2009
172
173 SEE ALSO
d6927ad @miyagawa Checking in changes prior to tagging of version 0.9964.
miyagawa authored Jan 24, 2011
174 The PSGI specification upon which Plack is based.
175
176 <http://plackperl.org/>
177
178 The Plack wiki: <https://github.com/miyagawa/Plack/wiki>
179
180 The Plack FAQ: <https://github.com/miyagawa/Plack/wiki/Faq>
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
181
182 LICENSE
183 This library is free software; you can redistribute it and/or modify it
184 under the same terms as Perl itself.
185
Something went wrong with that request. Please try again.