Mojo::U...::Server(3)
π NAME π
okay so bestie, this page is Mojo::UserAgent::Server β the Application server π
. The header shows up as Mojo::U...::Server(3), and it's part of the User Contributed Perl Documentation collection. the truncation is real, but we move π.
π SYNOPSIS π
here's the whole starter pack:
use Mojo::UserAgent::Server;
my $server = Mojo::UserAgent::Server->new;
say $server->url;
πΈ DESCRIPTION πΈ
Mojo::UserAgent::Server is an embedded web server based on Mojo::Server::Daemon that processes requests for Mojo::UserAgent. it's giving tiny server with main character energy, no cap β periodt β¨.
β¨ ATTRIBUTES β¨
Mojo::UserAgent::Server implements the following attributes β here's the lineup, bestie:
π ioloop
my $loop = $server->ioloop;
$server = $server->ioloop(Mojo::IOLoop->new);
This is the event loop object used for I/O operations, and it defaults to the global Mojo::IOLoop singleton. highkey the engine room of the vibe π.
π METHODS π
Mojo::UserAgent::Server inherits all methods from Mojo::Base and implements the following new ones. slay inheritance π.
π± app
my $app = Mojo::UserAgent::Server->app;
Mojo::UserAgent::Server->app(Mojolicious->new);
my $app = $server->app;
$server = $server->app(Mojolicious->new);
This is the application the server handles, and instance-specific applications override the global default. iykyk, per-instance app said "I'm the main character" π .
# Change application behavior
$server->app->defaults(testing => 'oh yea!');
π¦ nb_url
my $url = $server->nb_url;
my $url = $server->nb_url('http');
my $url = $server->nb_url('https');
Hands you an absolute Mojo::URL object for the server while it processes non-blocking requests with app, and it switches protocol if necessary. non-blocking bestie behavior fr fr β¨.
π₯ restart
$server->restart;
Restarts the server with a new port. glow-up via restart, literally π.
β url
my $url = $server->url;
my $url = $server->url('http');
my $url = $server->url('https');
Hands you an absolute Mojo::URL object for the server while it processes blocking requests with app, and it switches protocol if necessary. blocking requests said "I'm the moment" π
.
π SEE ALSO π
Mojolicious, Mojolicious::Guides, and <https://mojolicious.org> β go read those, bestie π«Ά.
okay that's the page π it's from perl v5.42.0, dated 2026-07-15, and the footer is literally Mojo::U...::Server(3) β iconic. πβ¨
π¦ 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