.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "CGI::Application::Server 3pm" .TH CGI::Application::Server 3pm "2020-11-09" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" CGI::Application::Server \- a simple HTTP server for developing with CGI::Application .SH "VERSION" .IX Header "VERSION" version 0.063 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 5 \& use CGI::Application::Server; \& use MyCGIApp; \& use MyCGIApp::Admin; \& use MyCGI::App::Account::Dispatch; \& use MyCGIApp::DefaultApp; \& \& my $server = CGI::Application::Server\->new(); \& \& # this CGI::Application object will stay persistent, might not be safe to use \& # in this way \- your mileage may vary \& # http://www.mail\-archive.com/cgiapp@lists.erlbaum.net/msg08997.html \& my $object = MyOtherCGIApp\->new(PARAMS => { foo => 1, bar => 2 }); \& \& $server\->document_root(\*(Aq./htdocs\*(Aq); \& $server\->entry_points({ \& \*(Aq/\*(Aq => \*(AqMyCGIApp::DefaultApp\*(Aq, \& \*(Aq/index.cgi\*(Aq => \*(AqMyCGIApp\*(Aq, \& \*(Aq/admin\*(Aq => \*(AqMyCGIApp::Admin\*(Aq, \& \*(Aq/account\*(Aq => \*(AqMyCGIApp::Account::Dispatch\*(Aq, \& \*(Aq/users\*(Aq => $object, \& \*(Aq/static\*(Aq => \*(Aq/usr/local/htdocs\*(Aq, \& }); \& $server\->run(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a simple \s-1HTTP\s0 server for for use during development with CGI::Application. At this moment, it serves our needs in a very basic way. The plan is to release early and release often, and add features when we need them. That said, we welcome any and all patches, tests and feature requests (the ones with which are accompanied by failing tests will get priority). .SH "METHODS" .IX Header "METHODS" .SS "\fBnew ($port)\fP" .IX Subsection "new ($port)" This acts just like \f(CW\*(C`new\*(C'\fR for HTTP::Server::Simple, except it will initialize instance slots that we use. .SS "\fBhandle_request\fP" .IX Subsection "handle_request" This will check the request uri and dispatch appropriately, either to an entry point, or serve a static file (html, jpeg, gif, etc). .SS "\fBentry_points (?$entry_points)\fP" .IX Subsection "entry_points (?$entry_points)" This accepts a \s-1HASH\s0 reference in \f(CW$entry_points\fR, which maps server entry points (uri) to CGI::Application or CGI::Application::Dispatch class names or objects or to directories from which static content will be served by HTTP::Server::Simple::Static. See the \s-1SYNOPSIS\s0 above for examples. .SS "\fBis_valid_entry_point ($uri)\fP" .IX Subsection "is_valid_entry_point ($uri)" This attempts to match the \f(CW$uri\fR to an entry point. .SS "\fBdocument_root (?$document_root)\fP" .IX Subsection "document_root (?$document_root)" This is the server's document root where all static files will be served from. .SH "CAVEATS" .IX Header "CAVEATS" This is a subclass of HTTP::Server::Simple and all of its caveats apply here as well. .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" The \s-1HTTP\s0 response handling was shamelessly stolen from HTTP::Request::AsCGI by chansen .SH "AUTHORS" .IX Header "AUTHORS" .IP "\(bu" 4 Stevan Little .IP "\(bu" 4 Rob Kinyon .IP "\(bu" 4 Ricardo \s-1SIGNES\s0 .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2006 by Infinity Interactive, Inc. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.