CGI::A...Server(3pm)
π CGI::Application::Server π
okay bestie, so this is a page from the User Contributed Perl Documentation and it's all about CGI::Application::Server, which β ngl β is literally the cutest lil HTTP server for when you're out here developing with CGI::Application. no cap. let's get into it π«Ά
β¨ NAME β¨
CGI::Application::Server β a simple HTTP server for developing with CGI::Application π
πΈ VERSION πΈ
version 0.063 β¨
π SYNOPSIS π
look at this gorgeous little setup, she's giving main character energy:
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('./htdocs');
$server->entry_points({
'/' => 'MyCGIApp::DefaultApp',
'/index.cgi' => 'MyCGIApp',
'/admin' => 'MyCGIApp::Admin',
'/account' => 'MyCGIApp::Account::Dispatch',
'/users' => $object,
'/static' => '/usr/local/htdocs',
});
$server->run();
heads up babe: that $object up there stays persistent, and apparently that might not be safe to use that way β your mileage may vary π
π¦ DESCRIPTION π¦
so basically? this is a simple HTTP server meant for use during development with CGI::Application. at this moment, it serves our needs in a very basic way β and honestly, that's the vibe. the plan is to release early and release often, and add features when we need them. periodt. π
that said, we welcome any and all patches, tests and feature requests π₯Ί and the ones that come with failing tests? they get priority. no cap. π₯
π METHODS π
π new ($port)
this acts just like "new" for HTTP::Server::Simple, except it will also initialize the instance slots that we use. so it's new but β¨extraβ¨.
π 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). she does it all, fr fr.
π entry_points (?$entry_points)
this accepts a HASH reference in $entry_points, 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. peek the SYNOPSIS above for examples, iykyk π
π§ is_valid_entry_point ($uri)
this attempts to match the $uri to an entry point. vibe check for uris, essentially π
β document_root (?$document_root)
this is the server's document root β where all the static files will be served from. her home base, her safe space π
π CAVEATS π
this is a subclass of HTTP::Server::Simple, and all of its caveats apply here as well. not me inheriting all the baggage too π
π ACKNOWLEDGEMENTS π
the HTTP response handling was shamelessly stolen from HTTP::Request::AsCGI by chansen. iconic behaviour, honestly. ate. π
π«Ά AUTHORS π«Ά
- Stevan Little <stevan@iinteractive.com>
- Rob Kinyon <rob.kinyon@iinteractive.com>
- Ricardo SIGNES <rjbs@cpan.org>
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2006 by Infinity Interactive, Inc.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay. π
and that's the whole page bestie!! this manual page came to you courtesy of perl v5.32.0, dated 2020-11-09, and yeah β the manual name is CGI::A...Server(3pm), all folded up nicely like we said π mwah, go write some CGI::Application code, you got this πβ¨
π¦ where this page comes from
- debian bookworm: libcgi-application-server-perl 0.063-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcgi-application-server-perl 0.063-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libcgi-application-server-perl 0.063-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcgi-application-server-perl 0.063-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcgi-application-server-perl 0.063-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcgi-application-server-perl 0.063-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms