Web::S...loyment(3pm)
π Web::Simple::Deployment π
okay bestie, so this is Web::Simple::Deployment(3pm) β like, the manual page, and it's your whole guide to deploying a Web::Simple app. Get comfy. π«Ά
β¨ NAME β¨
Web::Simple::Deployment β various deployment options π
πΈ DESCRIPTION πΈ
This file documents common deployment methods for Web::Simple. No cap, it's just the rundown of the ways you can get your app out into the world.
And if you're sitting there like "bestieβ¦ a method is missing??" β please ask in the IRC channel and we'll work with you to add it. Fr fr, they want to help. π
πΎ CGI πΎ
The most basic deployment option, the entry-level slay, is running your thing as a CGI script that loads and runs your Web::Simple-module:
#!/usr/bin/env perl
use Your::Web::Simple::App;
Your::Web::Simple::App->run_if_script;
Save that as script.cgi and your web server will handle it correctly. That's it. That's the whole vibe. β¨
π Plack-Server π
okay so this one works with exactly the same code as CGI deployment β same file, same everything. The only glow-up is that instead of letting your web server load script.cgi, you run this on the command line:
plackup script.cgi
Iconic. π
π§ Self-contained CGI π§
Sometimes your app is so smol β like, you've got only one or two tiny classes β that you just want to run it as a CGI script and not make a whole thing of it. And Web::Simple offers a helpful mechanism to achieve that. Obsessed, honestly.
#!/usr/bin/env perl
use Web::Simple 'HelloWorld'; # enables strictures and warnings for the file
# additionally, HelloWorld is upgraded to a
# Web::Simple application
{
package HelloWorld;
sub dispatch_request {
sub (GET) {
[
200,
[ 'Content-type', 'text/plain' ],
[ 'Hello world! It is a fine ' . HelloWorld::Helper->day ]
]
},
sub () {
[ 405, [ 'Content-type', 'text/plain' ], [ 'Method not allowed' ] ]
}
}
}
{
package HelloWorld::Helper;
use DateTime;
sub day {
return DateTime->now->day_name;
}
}
HelloWorld->run_if_script;
look at her. main character energy. π¦
π AUTHORS π
See Web::Simple for authors. (iykyk, all the credit lives over there π)
π COPYRIGHT AND LICENSE π
See Web::Simple for the copyright and license.
k that's the whole page bestie, go deploy something gorgeous πβ¨
mwah π β this was perl v5.34.0, dated 2022-06-28, from the Web::S...loyment(3pm) era of the docs π
π¦ where this page comes from
- debian bookworm: libweb-simple-perl 0.033-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libweb-simple-perl 0.033-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libweb-simple-perl 0.033-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libweb-simple-perl 0.033-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libweb-simple-perl 0.033-2 Β· 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