Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 179 lines (128 sloc) 6.095 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
d9c779c @miyagawa mentions Paste
miyagawa authored
5 Plack is a set of tools for using PSGI stack. It contains middleware
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
54 reference. See eg/dot-psgi directory for more examples of ".psgi" files.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
55
0f1a389 @miyagawa Checking in changes prior to tagging of version 0.9026. Changelog di…
miyagawa authored
56 plackup, Plack::Runner
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
57 plackup is a command line launcher to run PSGI applications from command
58 line using Plack::Loader to load PSGI backends. It can be used to run
59 standalone servers and FastCGI daemon processes. Other server backends
60 like Apache2 needs a separate configuration but ".psgi" application file
61 can still be the same.
62
0f1a389 @miyagawa Checking in changes prior to tagging of version 0.9026. Changelog di…
miyagawa authored
63 If you want to write your own frontend that replaces, or adds
64 functionalities to plackup, take a look at Plack::Runner module.
65
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
66 Plack::Middleware
67 PSGI middleware is a PSGI application that wraps existent PSGI
68 application and plays both side of application and servers. From the
69 servers the wrapped code reference still looks like and behaves exactly
70 the same as PSGI applications.
71
72 Plack::Middleware gives you an easy way to wrap PSGI applications with a
73 clean API, and compatibility with Plack::Builder DSL.
74
75 Plack::Builder
fb031b2 @miyagawa remove feature() and make them all required to be less annoying
miyagawa authored
76 Plack::Builder gives you a DSL that you can enable Middleware in ".psgi"
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
77 files to wrap existent PSGI applications.
78
79 Plack::Request, Plack::Response
80 Plack::Request gives you a nice wrapper API around PSGI $env hash to get
81 headers, cookies and query parameters much like Apache::Request in
82 mod_perl.
83
84 Plack::Response does the same to construct the response array reference.
85
86 Plack::Test
87 Plack::Test is an unified interface to test your PSGI application using
88 standard HTTP::Request and HTTP::Response pair with simple callbacks.
89
90 Plack::Test::Suite
91 Plack::Test::Suite is a test suite to test a new PSGI server backend.
92
8c1aa81 @miyagawa Checking in changes prior to tagging of version 0.9021. Changelog di…
miyagawa authored
93 CONTRIBUTING
94 Patches and Bug Fixes
95 Small patches and bug fixes can be either submitted via nopaste on IRC
25646f2 @miyagawa update CONTRIBUTING
miyagawa authored
96 <irc://irc.perl.org/#plack> or the github issue tracker
97 <http://github.com/miyagawa/Plack/issues>. Forking on github
98 <http://github.com/miyagawa/Plack> is another good way if you intend to
99 make larger fixes.
100
101 See also <http://contributing.appspot.com/plack> when you think this
102 document is terribly outdated.
8c1aa81 @miyagawa Checking in changes prior to tagging of version 0.9021. Changelog di…
miyagawa authored
103
104 Module Namespaces
105 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
106 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
107 Plack.
108
109 Middleware authors are free to use the Plack::Middleware:: namespace for
110 their middleware components. Middleware must be written in the pipeline
111 style such that they can chained together with other middleware
112 components. The Plack::Middleware:: modules in the core distribution are
113 good examples of such modules. It is recommended that you inherit from
114 Plack::Middleware for these types of modules.
115
116 Not all middleware components are wrappers, but instead are more like
117 endpoints in a middleware chain. These types of components should use
118 the Plack::App:: namespace. Again, look in the core modules to see
119 excellent examples of these (Plack::App::File, Plack::App::Directory,
120 etc.). It is recommended that you inherit from Plack::Component for
121 these types of modules.
122
9d1f776 @miyagawa added notes about Task::Plack in Makefile.PL
miyagawa authored
123 DO NOT USE Plack:: namespace to build a new web application or a
124 framework. It's like naming your application under CGI:: namespace if
125 it's supposed to run on CGI and that is a really bad choice and confuse
126 people.
127
e8ebfd2 @miyagawa regen README
miyagawa authored
128 AUTHOR
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored
129 Tatsuhiko Miyagawa
130
a0e47b2 @miyagawa change the order so M::I can pick it up correctly
miyagawa authored
131 COPYRIGHT
99898d3 @miyagawa Checking in changes prior to tagging of version 0.9935.
miyagawa authored
132 The following copyright notice applies to all the files provided in this
133 distribution, including binary files, unless explicitly noted otherwise.
134
a0e47b2 @miyagawa change the order so M::I can pick it up correctly
miyagawa authored
135 Copyright 2009-2010 Tatsuhiko Miyagawa
136
e8ebfd2 @miyagawa regen README
miyagawa authored
137 CONTRIBUTORS
138 Yuval Kogman (nothingmuch)
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored
139
e8ebfd2 @miyagawa regen README
miyagawa authored
140 Tokuhiro Matsuno (tokuhirom)
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored
141
e8ebfd2 @miyagawa regen README
miyagawa authored
142 Kazuhiro Osawa (Yappo)
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored
143
3b9b567 @miyagawa Checking in changes prior to tagging of version 0.99_23.
miyagawa authored
144 Kazuho Oku
e8ebfd2 @miyagawa regen README
miyagawa authored
145
146 Florian Ragwitz (rafl)
147
148 Chia-liang Kao (clkao)
149
150 Masahiro Honma (hiratara)
151
152 Daisuke Murase (typester)
153
154 John Beppu
155
156 Matt S Trout (mst)
157
158 Shawn M Moore (Sartak)
159
160 Stevan Little
161
162 Hans Dieter Pearcey (confound)
163
164 Tomas Doran (t0m)
165
166 mala
167
168 Mark Stosberg
169
170 Aaron Trevena
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
171
172 SEE ALSO
578693f @miyagawa test_requires
miyagawa authored
173 PSGI <http://plackperl.org/>
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored
174
175 LICENSE
176 This library is free software; you can redistribute it and/or modify it
177 under the same terms as Perl itself.
178
Something went wrong with that request. Please try again.