Mojo::Server::PSGI(3)
πΈ Mojo::Server::PSGI(3) πΈ
This is the User Contributed Perl Documentation page for Mojo::Server::PSGI, bestie β manual name right up top: Mojo::Server::PSGI(3). We're doing full group-chat energy, but every detail is staying. Periodt. π
β¨ NAME β¨
Mojo::Server::PSGI β PSGI server. Short, sweet, and absolutely serving. π
π¦ SYNOPSIS π¦
use Mojo::Server::PSGI;
my $psgi = Mojo::Server::PSGI->new;
$psgi->unsubscribe('request')->on(request => sub ($psgi, $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;
});
my $app = $psgi->to_psgi_app;
π DESCRIPTION π
So, <pink>Mojo::Server::PSGI</pink> lets <purple>Mojolicious</purple> applications run on all PSGI compatible servers. No cap β all of them. π«Ά
For more, see "DEPLOYMENT" in Mojolicious::Guides::Cookbook. That's the guide, bestie. π
π EVENTS π
Mojo::Server::PSGI inherits all events from Mojo::Server. That's the whole section, and honestly? Inheriting slay. π
π₯ ATTRIBUTES π₯
Mojo::Server::PSGI inherits all attributes from Mojo::Server. Same energy, same source. β¨
π METHODS π
Mojo::Server::PSGI inherits all methods from Mojo::Server and implements the following new ones. Let's get into it. π«Ά
π run π
my $res = $psgi->run($env);
Run PSGI. That's it. That's the method. Iconic and to the point. π
π¦ to_psgi_app π¦
my $app = $psgi->to_psgi_app;
Turn Mojolicious application into PSGI application. Literally the glow-up. π
π SEE ALSO π
MojoliciousMojolicious::Guides<https://mojolicious.org>
xoxo, your Unix bestie π β this page is from perl v5.42.0, dated 2026-07-15. Mwah! π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Mojolicious 9.480.0-bp160.2.1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms