Skip to content
Newer
Older
100644 168 lines (120 sloc) 5.48 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
d9c779c @miyagawa mentions Paste
miyagawa authored Feb 1, 2010
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 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
7397d0f @miyagawa support -option in Runner
miyagawa authored Jan 12, 2010
15 have adapters for Standalone, CGI, FCGI, Apache, AnyEvent, Coro,
16 Danga::Socket and many server environments that you can run PSGI
17 applications on.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
18
fd0f167 @miyagawa update docs
miyagawa authored Jan 15, 2010
19 See Plack::Handler how to write your own adapters.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
20
21 Plack::Loader
7397d0f @miyagawa support -option in Runner
miyagawa authored Jan 13, 2010
22 Plack::Loader is a loader to load one of Plack::Server adapters and run
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
23 PSGI application code reference with it.
24
25 Plack::Util
26 Plack::Util contains a lot of utility functions for server implementors
27 as well as middleware authors.
28
29 .psgi files
30 PSGI application is a code reference but it's not easy to pass code
31 reference in the command line or configuration files, so Plack uses a
32 convention that you need a file named "app.psgi" or alike, which would
33 be loaded (via perl's core function "do") to return the PSGI application
d7499e3 @miyagawa improve .psgi files documentation
miyagawa authored Feb 9, 2010
34 code reference.
35
36 # Hello.psgi
37 my $app = sub {
38 my $env = shift;
39 # ...
40 return [ $status, $headers, $body ];
41 };
42
43 If you use a web framework, chances are that they provide a helper
44 utility to automatically generate these ".psgi" files for you, such as:
45
46 # MyApp.psgi
47 use MyApp;
48 my $app = sub { MyApp->run_psgi(@_) };
49
50 It's important that the return value of ".psgi" file is the code
51 reference. See eg/dot-psgi directory for more examples of ".psgi" files.
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
52
0f1a389 @miyagawa Checking in changes prior to tagging of version 0.9026. Changelog dif…
miyagawa authored Jan 1, 2010
53 plackup, Plack::Runner
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
54 plackup is a command line launcher to run PSGI applications from command
55 line using Plack::Loader to load PSGI backends. It can be used to run
56 standalone servers and FastCGI daemon processes. Other server backends
57 like Apache2 needs a separate configuration but ".psgi" application file
58 can still be the same.
59
0f1a389 @miyagawa Checking in changes prior to tagging of version 0.9026. Changelog dif…
miyagawa authored Jan 1, 2010
60 If you want to write your own frontend that replaces, or adds
61 functionalities to plackup, take a look at Plack::Runner module.
62
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
63 Plack::Middleware
64 PSGI middleware is a PSGI application that wraps existent PSGI
65 application and plays both side of application and servers. From the
66 servers the wrapped code reference still looks like and behaves exactly
67 the same as PSGI applications.
68
69 Plack::Middleware gives you an easy way to wrap PSGI applications with a
70 clean API, and compatibility with Plack::Builder DSL.
71
72 Plack::Builder
fb031b2 @miyagawa remove feature() and make them all required to be less annoying
miyagawa authored Oct 27, 2009
73 Plack::Builder gives you a DSL that you can enable Middleware in ".psgi"
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
74 files to wrap existent PSGI applications.
75
76 Plack::Request, Plack::Response
77 Plack::Request gives you a nice wrapper API around PSGI $env hash to get
78 headers, cookies and query parameters much like Apache::Request in
79 mod_perl.
80
81 Plack::Response does the same to construct the response array reference.
82
83 Plack::Test
84 Plack::Test is an unified interface to test your PSGI application using
85 standard HTTP::Request and HTTP::Response pair with simple callbacks.
86
87 Plack::Test::Suite
88 Plack::Test::Suite is a test suite to test a new PSGI server backend.
89
8c1aa81 @miyagawa Checking in changes prior to tagging of version 0.9021. Changelog dif…
miyagawa authored Dec 8, 2009
90 CONTRIBUTING
91 Patches and Bug Fixes
92 Small patches and bug fixes can be either submitted via nopaste on IRC
93 <irc://irc.perl.org/#plack> or email. You could also fork on github
94 (http://github.com/miyagawa/Plack) to make larger fixes.
95
96 Module Namespaces
97 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
98 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
99 Plack.
100
101 Middleware authors are free to use the Plack::Middleware:: namespace for
102 their middleware components. Middleware must be written in the pipeline
103 style such that they can chained together with other middleware
104 components. The Plack::Middleware:: modules in the core distribution are
105 good examples of such modules. It is recommended that you inherit from
106 Plack::Middleware for these types of modules.
107
108 Not all middleware components are wrappers, but instead are more like
109 endpoints in a middleware chain. These types of components should use
110 the Plack::App:: namespace. Again, look in the core modules to see
111 excellent examples of these (Plack::App::File, Plack::App::Directory,
112 etc.). It is recommended that you inherit from Plack::Component for
113 these types of modules.
114
9d1f776 @miyagawa added notes about Task::Plack in Makefile.PL
miyagawa authored Dec 15, 2009
115 DO NOT USE Plack:: namespace to build a new web application or a
116 framework. It's like naming your application under CGI:: namespace if
117 it's supposed to run on CGI and that is a really bad choice and confuse
118 people.
119
eaf47fd @miyagawa Added copyright info
miyagawa authored Jan 6, 2010
120 COPYRIGHT
121 Copyright 2009- Tatsuhiko Miyagawa
122
e8ebfd2 @miyagawa regen README
miyagawa authored Feb 6, 2010
123 AUTHOR
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored Oct 21, 2009
124 Tatsuhiko Miyagawa
125
e8ebfd2 @miyagawa regen README
miyagawa authored Feb 6, 2010
126 CONTRIBUTORS
127 Yuval Kogman (nothingmuch)
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored Oct 21, 2009
128
e8ebfd2 @miyagawa regen README
miyagawa authored Feb 6, 2010
129 Tokuhiro Matsuno (tokuhirom)
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored Oct 21, 2009
130
e8ebfd2 @miyagawa regen README
miyagawa authored Feb 6, 2010
131 Kazuhiro Osawa (Yappo)
76b0753 @miyagawa make Static dependencies as optional (but default on)
miyagawa authored Oct 21, 2009
132
e8ebfd2 @miyagawa regen README
miyagawa authored Feb 6, 2010
133 Kzzuho Oku
134
135 Florian Ragwitz (rafl)
136
137 Chia-liang Kao (clkao)
138
139 Masahiro Honma (hiratara)
140
141 Daisuke Murase (typester)
142
143 John Beppu
144
145 Matt S Trout (mst)
146
147 Shawn M Moore (Sartak)
148
149 Stevan Little
150
151 Hans Dieter Pearcey (confound)
152
153 Tomas Doran (t0m)
154
155 mala
156
157 Mark Stosberg
158
159 Aaron Trevena
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
160
161 SEE ALSO
578693f @miyagawa test_requires
miyagawa authored Oct 4, 2009
162 PSGI <http://plackperl.org/>
ed99f15 @miyagawa use Module::Install::ReadmeFromPod
miyagawa authored Sep 30, 2009
163
164 LICENSE
165 This library is free software; you can redistribute it and/or modify it
166 under the same terms as Perl itself.
167
Something went wrong with that request. Please try again.