Mojolic...::Mount(3)

πŸ’… Mojolic...::Mount(3) β€” the manual page, bestie edition

okay so this is the Mojolic...::Mount(3) page from the User Contributed Perl Documentation section, and honestly? it's giving "small plugin, big main character energy" πŸŽ€ like it's short, but it does a LOT, so stay with me.

✨ NAME ✨

Mojolicious::Plugin::Mount β€” it's the Application mount plugin, periodt. πŸ‘‘

πŸ¦‹ SYNOPSIS πŸ¦‹

bestie just look at the code, it's all right here:

# Mojolicious
my $route = $app->plugin(Mount => {'/prefix' => '/home/sri/foo/script/foo'});

# Mojolicious::Lite
my $route = plugin Mount => {'/prefix' => '/home/sri/myapp.pl'};

# Adjust the generated route and mounted application
my $example = plugin Mount => {'/example' => '/home/sri/example.pl'};
$example->to(message => 'It works great!');
my $app = $example->pattern->defaults->{app};
$app->config(foo => 'bar');
$app->log(app->log);

# Mount application with host
plugin Mount => {'example.com' => '/home/sri/myapp.pl'};

# Host and path
plugin Mount => {'example.com/myapp' => '/home/sri/myapp.pl'};

# Or even hosts with wildcard subdomains
plugin Mount => {'*.example.com/myapp' => '/home/sri/myapp.pl'};

like… host mounting? wildcard subdomains? we love a plugin that scales πŸ’…βœ¨


🌸 DESCRIPTION 🌸

Mojolicious::Plugin::Mount is a plugin that lets you mount whole Mojolicious applications. not a route, not a controller β€” an entire app, mounted. slay. 🫢

and here's the cute part: the code of this plugin is literally a good example for learning to build new plugins, so you're welcome to fork it. do it. i believe in you. 🧚

if you want the full roster of what ships by default, see "PLUGINS" in Mojolicious::Plugins β€” that's where the list of plugins available by default lives.


πŸ’œ METHODS πŸ’œ

Mojolicious::Plugin::Mount inherits all methods from Mojolicious::Plugin and implements the following new ones. yes, all of them, no cap.

⭐ register

my $route = $plugin->register(Mojolicious->new, {'/foo' => '/some/app.pl'});

this one mounts a Mojolicious application and returns the generated route β€” which is usually a Mojolicious::Routes::Route object. you get the route back, you can keep vibing with it. πŸ”₯


🌈 SEE ALSO 🌈

like, go read them, iykyk πŸ“šπŸ’–


okay that's the whole page, you ate that πŸ“ and for the credits: this was perl v5.42.0, dated 2026-07-15 β€” shoutout to the Mojolic...::Mount(3) girlies, see you in the next manpage πŸ˜­πŸ’…βœ¨

πŸ“¦ where this page comes from