Plack::...:PSGIBin(3)

πŸ¦‹ Plack::App::PSGIBin β€” the Perl doc for the Perl girlies πŸ’…

okay bestie, grab your boba, because this one is a Plack app that serves up .psgi files straight out of a directory like it's a little vending machine of web apps πŸ“βœ¨ (it lives in the User Contributed Perl Documentation corner of the Plack::...:PSGIBin(3) manual, iykyk)


✨ NAME ✨

Plack::App::PSGIBin β€” it runs .psgi files from a directory. that's it. that's the whole vibe. πŸ‘‘


🌸 SYNOPSIS 🌸

like, here's how you'd actually use it:

use Plack::App::PSGIBin;
use Plack::Builder;

my $app = Plack::App::PSGIBin->new(root => "/path/to/psgi/scripts")->to_app;
builder {
    mount "/psgi" => $app;
};

# Or from the command line
plackup -MPlack::App::PSGIBin -e 'Plack::App::PSGIBin->new(root => "/path/psgi/scripts")->to_app'

no cap, copy that and go πŸ’–


πŸŽ€ DESCRIPTION πŸŽ€

so basically this application loads .psgi files β€” or actually, whichever filename extensions you're feeling, it does not gatekeep β€” from the root directory and runs it as a PSGI application. periodt. πŸ”₯

imagine you have a directory containing foo.psgi and bar.psgi. map this application to /app with Plack::App::URLMap, and boom, you can access them via the URL:

http://example.com/app/foo.psgi
http://example.com/app/bar.psgi

and that's how you load them πŸ’«

now for the glow-up tip πŸ‘‘: you can rename the file to the one without the .psgi extension to make the URL look nicer (aesthetically pleasing URLs are the main character energy we deserve), or use URL rewriting tools like Plack::Middleware::Rewrite to do the same thing. either way, slay. ✨


πŸ’œ AUTHOR πŸ’œ

Tatsuhiko Miyagawa β€” the icon who made this 🫢


🌈 SEE ALSO 🌈

  • Plack::App::CGIBin β€” the sibling, the cousin, the family πŸ’–

and that's the whole page, bestie! 🧚 it's from the User Contributed Perl Documentation, running perl v5.42.3, dated 2026-10-18, filed under Plack::...:PSGIBin(3). drink water, write your tests, and go be the main character of your own app πŸ’…β­

πŸ“¦ where this page comes from