Perl500503Syntax-OrDie
view release on metacpan or search on metacpan
t/corpus-stack/PSGI-Handy/lib/PSGI/Handy.pm view on Meta::CPAN
# for example, with HTTP::Handy as the delivery layer:
use HTTP::Handy;
HTTP::Handy->run(app => $psgi_app, host => '127.0.0.1', port => 8080);
=head1 TABLE OF CONTENTS
=over 4
=item * L</DESCRIPTION>
=item * L</METHODS>
=item * L</DIAGNOSTICS>
=item * L</LIMITATIONS>
=item * L</SEE ALSO>
=back
=head1 DESCRIPTION
PSGI::Handy is the application layer of the "Handy" stack. It wires a
L<PSGI::Handy::Router>, L<PSGI::Handy::Request>,
L<PSGI::Handy::Response> and L<PSGI::Handy::Context> into a single
PSGI-subset C<$app> through C<to_app>. Templates and a database handle
are injected at construction time, so the framework loads nothing
outside the Perl core and stays easy to test. You serve the resulting
C<$app> with any PSGI server, such as L<HTTP::Handy>.
Every handler receives a L<PSGI::Handy::Context> and may return a
Response object, a raw PSGI array reference, or a plain string (treated
as an HTML 200 response).
=head1 METHODS
new, renderer, db, config, router, route, get, post, put, patch, del,
head, any, before, after, to_app.
Routing details (named C<:params>, trailing C<*>, exact matching, 405
handling) are documented in L<PSGI::Handy::Router>.
=head1 DIAGNOSTICS
=over 4
=item C<before: a code reference is required>
The argument to C<before> was not a CODE reference.
=item C<after: a code reference is required>
The argument to C<after> was not a CODE reference.
=back
=head1 LIMITATIONS
The C<$app> returned by C<to_app> always produces the buffered,
three-element PSGI response C<[ $status, \@headers, \@body ]>. The PSGI
delayed-response form (the streaming "responder" callback) is not
generated; this is what "PSGI-subset" means throughout this distribution.
Concurrency and the HTTP version depend on the PSGI server you choose.
No multipart uploads or WebSocket in this version. C<HEAD> requests are
served by the matching C<GET> route with the body removed.
=head1 SEE ALSO
L<HTTP::Handy>, L<HP::Handy>, L<PSGI::Handy::Router>,
L<PSGI::Handy::Request>, L<PSGI::Handy::Response>,
L<PSGI::Handy::Context>
=head1 AUTHOR
INABA Hitoshi E<lt>ina.cpan@gmail.comE<gt>
=head1 COPYRIGHT AND LICENSE
This software is distributed under the same terms as Perl itself.
=cut
( run in 0.795 second using v1.01-cache-2.11-cpan-140bd7fdf52 )