Mojo::Server::CGI(3)

πŸ’– NAME

Okay bestie, this is the User Contributed Perl Documentation for Mojo::Server::CGI(3) β€” aka Mojo::Server::CGI, the CGI server. πŸŽ€

✨ SYNOPSIS

Here's the vibe in code form, bestie:

use Mojo::Server::CGI;

my $cgi = Mojo::Server::CGI->new;
$cgi->unsubscribe('request')->on(request => sub ($cgi, $tx) {

  # Request
  my $method = $tx->req->method;
  my $path   = $tx->req->url->path;

  # Response
  $tx->res->code(200);
  $tx->res->headers->content_type('text/plain');
  $tx->res->body("$method request for $path!");

  # Resume transaction
  $tx->resume;
});
$cgi->run;

🌸 DESCRIPTION

Mojo::Server::CGI is a simple and portable implementation of RFC 3875 (https://tools.ietf.org/html/rfc3875). Literally iconic behavior. πŸ’…

For more, see "DEPLOYMENT" in Mojolicious::Guides::Cookbook. 🫢

πŸŽ€ EVENTS

Event check: Mojo::Server::CGI inherits all events from Mojo::Server. That's the event tea. πŸ’«

πŸ¦‹ ATTRIBUTES

It inherits all attributes from Mojo::Server and implements the following new ones. πŸ‘‡

πŸ’… nph

my $bool = $cgi->nph;
$cgi     = $cgi->nph($bool);

Activate non-parsed header mode. That's the whole nph moment. ✨

πŸ”₯ METHODS

It inherits all methods from Mojo::Server and implements the following new ones. πŸ‘‡

🌈 run

my $status = $cgi->run;

Run CGI. Short, sweet, slay. 🏁

πŸ‘‘ SEE ALSO


okay bestie, that's the whole page! πŸ’– It's from perl v5.42.0, dated 2026-07-15, and it's the manual for Mojo::Server::CGI(3). Periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from