RunApp(3pm)
β¨ RunApp β the manual page but make it a group chat β¨
okay bestie, gather round, because we're talking about RunApp from the Perl user-contributed docs (that's the 3pm manual, iykyk) π
RunApp is a generic module to run web-applications. That's the whole vibe. It's the friend who handles all the boring setup so you can be the main character. π«Ά
πΈ SYNOPSIS πΈ
here's what it actually looks like when you call it, no cap:
use RunApp '-chdir';
use RunApp;
use RunApp::Apache;
my $cmd = shift || 'development';
my $config = { var => 'value', app_apache => { var_for_apache => 'value'} };
RunApp->new (app_apache => RunApp::Apache->new
(root => catfile (cwd, $_),
httpd => '/path/to/httpd'),
my_daemon => RunApp::Control::AppControl->new
(binary => '/path/to/daemon',
args => ['--daemon'],
pidfile => '/path/to/daemon.pid',
)
)->$cmd ($config);
yes the ->$cmd ($config) thing is real, it's giving method-name-in-a-variable energy and honestly? iconic. β¨
π DESCRIPTION π
so RunApp streamlines the whole process of configuring applications that need one or more web servers and/or other daemons β whether you're doing development or deployment. it just... takes that chaos and makes it cute.
it builds the config files the services need straight out of the $config hash, like apache's httpd.conf. π
literally it's the "i got you" of config generation.
π¦ OPTIONS π¦
use RunApp '-chdir';
use RunApp qw(-chdir ..);
-chdirβ this makes your scriptchdirto the base directory. and bestie, if it's a symbolic link, it gets resolved, so you end up in the directory where the original script lives. thelibdirectory gets added into@INCtoo, so you can use the modules sitting in that path. periodt. π- it also takes an optional relative path if you want the script to
chdirsomewhere else instead. - and the reason this is so slay? it makes it possible to symlink your runapp script into the system's
rc.dstartup directory. π
π CONSTRUCTOR π
new (@services)
okay so @services is actually a hash, even though it's named like an array β the keys are the name of the service, and the values are RunApp::Control objects. π«Ά
β οΈ real talk: use an array instead of a hash here if you want to retain the order of dispatching. the order matters, bestie, don't let anyone tell you otherwise.
the names get used to pick config out of the hash, which gets flattened into the top level of the config hash when running build for each service. β¨
π METHODS π
$self->development ($conf)
runs build and start, and then just... waits. for SIGINT. to <stop> the servers. π
it's the "i'll be here when you need me" method.
π AUTOLOAD π
every other method gets dispatched to the RunApp::Control objects, in the order they were called in the CONSTRUCTOR. π
ngl, the way this works is: RunApp::Control dispatches to the dispatch method. iykyk. π§
β SEE ALSO β
RunApp::ApacheRunApp::Control::AppControlApp::Control
go read them, they're the supporting cast and they ate. π₯
π AUTHORS π
- Chia-liang Kao
<clkao@clkao.org> - Refactored from works by Leon Brocard
<acme@astray.com>and Tom Insam<tinsam@fotango.com>.
π COPYRIGHT π
Copyright (C) 2002-5, Fotango Ltd.
This module is free software; you can redistribute it or modify it under the same terms as Perl itself. πΈ
and that's the whole page, bestie β brought to you by perl v5.34.0, dated 2022-06-17, under the RunApp(3pm) name. now go forth and run your web-applications. slay. πβ¨π
π¦ where this page comes from
- debian bookworm: librunapp-perl 0.13-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: librunapp-perl 0.13-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: librunapp-perl 0.13-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: librunapp-perl 0.13-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: librunapp-perl 0.13-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms