use Mojo::Server::CGI;
my $cgi = Mojo::Server::CGI->new;
$cgi->unsubscribe('request')->on(request => sub {
my ($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;
See ``DEPLOYMENT'' in Mojolicious::Guides::Cookbook for more.
my $bool = $cgi->nph; $cgi = $cgi->nph($bool);
Activate non-parsed header mode.
my $status = $cgi->run;