Raisin::Routes - A routing class for Raisin.
use Raisin::Routes; my $r = Raisin::Routes->new; my $params = { require => ['name', ], }; my $code = sub { { name => $params{name} } } $r->add('GET', '/user', params => $params, $code); my $route = $r->find('GET', '/user');
The router provides the connection between the HTTP requests and the web application code.
$r->add('GET', '/user', params => $params, $code);
$r->find($method, $path);
Regexp
qr#/user/(\d+)#
Required
/user/:id
Optional
/user/?id
Adds a new route
Looking for a route
This module was inspired by Kelp::Routes.
Artur Khabibullin - rtkh <at> cpan.org
This module and all the modules in this package are governed by the same license as Perl itself.
To install Raisin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Raisin
CPAN shell
perl -MCPAN -e shell install Raisin
For more information on module installation, please visit the detailed CPAN module installation guide.