1Plack::App::PSGIBin(3)User Contributed Perl DocumentationPlack::App::PSGIBin(3)
2
3
4
6 Plack::App::PSGIBin - Run .psgi files from a directory
7
9 use Plack::App::PSGIBin;
10 use Plack::Builder;
11
12 my $app = Plack::App::PSGIBin->new(root => "/path/to/psgi/scripts")->to_app;
13 builder {
14 mount "/psgi" => $app;
15 };
16
17 # Or from the command line
18 plackup -MPlack::App::PSGIBin -e 'Plack::App::PSGIBin->new(root => "/path/psgi/scripts")->to_app'
19
21 This application loads .psgi files (or actually whichever filename
22 extensions) from the root directory and run it as a PSGI application.
23 Suppose you have a directory containing "foo.psgi" and "bar.psgi", map
24 this application to "/app" with Plack::App::URLMap and you can access
25 them via the URL:
26
27 http://example.com/app/foo.psgi
28 http://example.com/app/bar.psgi
29
30 to load them. You can rename the file to the one without ".psgi"
31 extension to make the URL look nicer, or use the URL rewriting tools
32 like Plack::Middleware::Rewrite to do the same thing.
33
35 Tatsuhiko Miyagawa
36
38 Plack::App::CGIBin
39
40
41
42perl v5.36.0 2023-01-20 Plack::App::PSGIBin(3)