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