Plack::App::URLHashMap - Map multiple apps in different paths
use Plack::App::URLHashMap; my $app1 = sub { ... }; my $app2 = sub { ... }; my $urlmap = Plack::App::URLMap->new; $urlmap->map( '/' => $app1 ); $urlmap->map( '/foo' => $app2 ); my $app = $urlmap->to_app;
This PSGI application is a simpler alternative to Plack::App::URLMap.
It dispatches requests to different apps by looking up PATH_INFO in a hash.
PATH_INFO
This application requires exact matching, /foo and /foo/ are different paths, as such you will need two entries if you want both to work. This works similar to a location = block in nginx.
Plack::App::URLMap
Copyright (C) 2014 CV-Library Ltd.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Plack::App::URLHashMap, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::App::URLHashMap
CPAN shell
perl -MCPAN -e shell install Plack::App::URLHashMap
For more information on module installation, please visit the detailed CPAN module installation guide.